14

I've got a bunch of AWS Lambda functions that I want to trigger at certain times of day, but those times are in different timezones. For example, I might want events to trigger at:

  • 4:55pm Sydney time
  • 6:30pm Chicago time
  • 9pm Chicago time

...and so on.

Using Cloudwatch events, regardless of which AWS region I use, it seems that I can only specify events to trigger using UTC (i.e. London time). For today, that's fine; I can work out the time differences between London and Sydney, and London and Chicago, and so on - however, summer time comes into effect on different dates in different cities, and it'll cause my Lambdas to trigger at the wrong times when it does.

Is there a way to trigger these Cloudwatch events using non-UTC time settings? Alternately, is there a mechanism other than Cloudwatch that I can use to trigger Lambda functions at specific times of day, AND specify those times in the timezone I want?

Thanks in advance

monch1962
  • 5,151
  • 5
  • 31
  • 38
  • 1
    Be careful - London is currently UTC but, starting on the 26th of March they will be in BST - British Summer Time. – stdunbar Feb 07 '17 at 02:34

1 Answers1

10

Be careful - London is currently (as of 6 February, 2017) UTC but, starting on the 26th of March 2017, they will be in BST - British Summer Time which will be UTC + 1. In other words, London time is not necessarily UTC.

To me, the best bet is to have another lambda update the cloudwatch trigger time based on known timezone changes. You don't show your implementation language but, as an example, in Java you could take a look at this post. Run this Lambda once a day at UTC time zero and update the cloudwatch rule times appropriately.

Community
  • 1
  • 1
stdunbar
  • 16,263
  • 11
  • 31
  • 53
  • 3
    It's unfortunate that there isn't a better solution than this, and a better solution hasn't been found in the five years since you answered this. There are many ways this sort of solution can go sideways, for example if you need to run a job near the time zone shift and the script to update the rule hasn't finished running yet. – Jon Jenkins Jun 03 '21 at 05:16
  • @JonJenkins Good news! AWS now offers a way to schedule across different timezones, via its new (as of Nov. 2022) EventBridge Scheduler: https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduler.html https://aws.amazon.com/blogs/compute/introducing-amazon-eventbridge-scheduler/ – Asker Jan 22 '23 at 09:15