Skip to content

⚡️🗺️⏰ Schedule AWS CloudWatch Event based invocations in local time(with DST support!)

Notifications You must be signed in to change notification settings

hughns/serverless-local-schedule

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Local Schedule

serverless npm

This plugin allows you to specify a timezone on your lambdas triggered by AWS CloudWatch Events.

To install:

sls plugin install -n serverless-local-schedule

For example:

functions:
  hello:
    handler: handler.hello
    events:
      - schedule:
          rate: cron(0 10 * * ? *)
          timezone: America/New_York

It works by converting that into 6 different schedules, effectively the same as having the following configuration:

functions:
  hello:
    handler: handler.hello
    events:
      - schedule:
          rate: cron(0 15 * 1-2,12 ? *) # full non-DST months
      - schedule:
          rate: cron(0 16 1-10 3 ? *) # non-DST portion of March
      - schedule:
          rate: cron(0 14 11-31 3 ? *) # DST portion of March
      - schedule:
          rate: cron(0 14 * 4-10 ? *) # full DST months
      - schedule:
          rate: cron(0 14 1-3 11 ? *) # DST portion of November
      - schedule:
          rate: cron(0 15 4-31 11 ? *) # non-DST portion of November

NOTE: the - schedule: cron(** * * ? *) short syntax isn't supported.

About

⚡️🗺️⏰ Schedule AWS CloudWatch Event based invocations in local time(with DST support!)

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 100.0%