Boilerplate for creating/deploying an AWS lamba service with schedule cron expression service using SAM.
aws cli
aws configure
https://itnext.io/creating-aws-lambda-applications-with-sam-dd13258c16dd
pip install aws-sam-cli
Note must include the AWS:Serverless-2016-10-31 Transform key. You don't need to touch anything here unless instructed.
This is ./deployment/template.yaml
file
aws s3 mb s3://sam-deployments-bucket
Update the deployment.yaml
file with the desired CRON expression
sam package --template-file ./deployment/template.yaml --output-template-file ./deployment/package.yaml --s3-bucket sam-deployments-bucket
sam deploy --template-file ./deployment/package.yaml --stack-name sam-deployment-boilerplate --capabilities CAPABILITY_IAM
This will stop the entire service.
aws cloudformation delete-stack --stack-name sam-deployment-boilerplate