Gurudeepak
Gurudeepak

Reputation: 431

How to change the Timezone in AWS Cloudwatch Event Cron expression?

Requirement: We have 4 clients in 4 different regions and we need to set up a Cron expression in the cloud watch event which needs to trigger lambda at a particular time every day.

Currently Cloudwatch is triggering the event based on GMT, how to change the timezone ?

Upvotes: 5

Views: 4527

Answers (2)

Jens
Jens

Reputation: 21510

Update: November 2022

EventBridge now supports time expressions, timezones, and DST:

Introducing Amazon EventBridge Scheduler - AWS Blog

Original: March 2021

You have to calculate the GMT times for the different regions yourself and then set them in EventBridge (CloudWatch).

For example, if you want to trigger an event at 5am local New York City (EDT) time, you need to convert that to GMT time. Which at the moment would be 9am. Then you set that value in your EventBridge (CloudWatch) event.

Upvotes: 6

Abhijeet Ahuja
Abhijeet Ahuja

Reputation: 5950

If you are using Serverless, then you can use the Serverless Local Schedule plugin, which can do the time zone conversions for you.

events:
  - schedule:
      rate: cron(0 8-20 * * ? *)
      timezone: Australia/Sydney

plugins:
  - serverless-local-schedule

Upvotes: 1

Related Questions