Files: Dockerfile, handler.py, template.yaml, samconfig.toml
- AWS CLI configured (
aws configure) - AWS SAM CLI (
brew install aws-sam-cli) - Docker
# Create ECR repository (first time only)
aws ecr create-repository --repository-name <project_name> --region us-east-1
sam build
sam deploySAM builds the Docker image, pushes to ECR, and creates the Lambda function.
sam remote invokesam logs --stack-name <project_name> --tail- Do not rename
handler.pyor thehandler()function — theDockerfileCMD ishandler.handler - Do not rename
workflow.pyor themain()function —handler.pyimports it - The
samconfig.tomlhas the stack name, region, and ECR repository pre-configured from cookiecutter - To change the schedule or add triggers, edit
template.yaml(seelambda-scheduledtemplate)