Skip to content

Instantly share code, notes, and snippets.

@em-shea
Last active April 24, 2023 17:52
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
An example SAM template for a Lambda function that's invoked by CloudWatch Events
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An example SAM template for a Lambda function that's invoked by a CloudWatch Event.
Resources:
MyFunction:
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: MyFunction
Handler: MyFunction.lambda_handler
Runtime: python3.7
CodeUri: ./MyFunction
Description: A function that is invoked by a CloudWatch Event.
Events:
MyCloudWatchEvent:
Type: Schedule
Properties:
# Read more about schedule expressions here:
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html
# This event runs every Friday at 16 UTC/9AM PST
Schedule: cron(0 16 ? * FRI *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment