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:
- Choose Schedule.
- Choose Fixed rate of and specify the schedule interval (for example, 5 minutes).
- For Targets, choose Add target, Lambda function.
- For Function, select the Lambda function that you created.
- Choose Configure details.
- For Rule definition, type a name and description for the rule.
- 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 * ? *