Home > other >  Trigger lambda from last 10 days of the month
Trigger lambda from last 10 days of the month

Time:04-08

I have a lambda that needs to be triggered daily at 5PM from 20th to 1st of every month. What would be the cron expression for it?

CodePudding user response:

You must use CloudWatch triggers to achieve this. To create a rule using the console

Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/

In the navigation pane, choose Events, Create rule.

For Event Source, do the following:

  1. Choose Schedule.
  2. Choose Fixed rate of and specify the schedule interval (for example, 5 minutes).
  3. For Targets, choose Add target, Lambda function.
  4. For Function, select the Lambda function that you created.
  5. Choose Configure details.
  6. For Rule definition, type a name and description for the rule.
  7. Choose Create rule.

Refer: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html

CodePudding user response:

Here is the cron expression (GMT Timezone):

0 17 20-1 * ? *
  • Related