Skip to content

An AWS Lambda base class that disables its triggering CloudWatch Rule after a timed expiration.

License

Notifications You must be signed in to change notification settings

cellepo/CloudWatchTimerLambda

Repository files navigation

CloudWatchTimerLambda

CloudWatchTimerLambda is an AWS-Lambda Java base class that disables its CloudWatch Rule (the rule that triggers your Lambda with a ScheduledEvent) after a timed expiration:
If for no other reason, use CloudWatchTimerLambda to lower billed AWS resources.

Extend CloudWatchTimerLambda by implementing its abstract #process method (to do your concrete Lambda's job).
Your Lambda will then have these benefits when it is run (all occur after processing):

Features

  • Stores (if not already stored) an expiration time for the triggering CloudWatch Rule to expire and be disabled
    • The expiration is the sum of the time that storage of the expiration occurs, plus a duration:
      • Duration is configured by Lambda Environment Variable: "SCHEDULED_EVENT_RULE_EXPIRY_DURATION_MILLIS"
    • The expiration is stored in S3
      • Name of its S3 bucket is configured by Lambda Environment Variable: "S3_BUCKET_NAME"
  • If expiration is already stored, and current time is after it, then the triggering CloudWatch Rule expires:
    • CloudWatch Rule is disabled
    • Stored expiration is deleted from S3

About

An AWS Lambda base class that disables its triggering CloudWatch Rule after a timed expiration.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages