Simple AWS Serverless Application Model example with Layer and a SQS destination
- aws-cli/2.0.56
- Python/3.7.3
- aws sam cli 1.15.0
AWS Lambda Layer with a simple sum function in the calculation module
AWS Lambda Function that references the calculation-layer and SQS destination that receives a message in case of failures (event with a simulate_error property)
cd calculation-layer
sam deploy --guided
cd sum-app
sam deploy --guided
3.1. Unit Test (pytest)
cd sum-app
make test
3.2. Local Test with SAM
cd sum-app
make invoke
3.2. AWS Test with AWS Cli
aws lambda invoke --cli-binary-format raw-in-base64-out --function-name sum-app-SumAppFunction-xxxxxxxxxxxxx --invocation-type Event --payload '{"n1":1,"n2":3}' response.json