Hello :wave::skin-tone-2:, how would I go about cr...
# aws
b
Hello 👋🏻, how would I go about creating a trigger for an AWS Lambda function ? For example, call the function upon a new entry in a CloudWatch log stream or upon a new file in an S3 bucket ? I could not find anything
trigger
in the AWS Lambda docs; do the docs use some other term or does Pulumi simply not support creating triggers ?
m
Hey! I once deployed a Lambda which needed to run on a weekly schedule.
Copy code
const schedule = aws.cloudwatch.onSchedule(
  "lambda-schedule",

  // This expression schedules the event to trigger at:
  // At 00:00,
  // for one or more days of the month,
  // for all months,
  // when it is a Monday,
  // for all years
  "cron(0 0 ? * MON *)",

  lambda
);
You can also trigger the lambda to run when a bucket gets a new file
b
Thanks, I’ll look into that 👍🏻 I did realize in the meantime, though that AWS does not seem to support AWS Lambda function triggers in any automated fashion: https://stackoverflow.com/q/56717199; that obviously might be a reason why Pulumi wouldn’t support them, either… Not far from giving up TBH and manage the triggers manually 😞