Serverless Application Model (SAM) Flashcards
SAM is both:
- CLI Tool
- CloudFormation Macro. It allows you to change the rules on how code works
What are 2 benefits of using CloudFormation macros?
Code is easier to read
Less overall code:
A pure CloudFormation file can have 100 lines
With SAM the same stack of resources can use 50 lines
Which attribute do you provide in CloudFormation to use a macro?
Transform
Transform: ‘AWS::Serverless-2016….”
This open-source framework for building serverless applications provides shorthand syntax to express functions, APIs, databases, and event source mappings.
AWS Serverless Application Model (SAM)
What is the SAM CLI command to turn your SAM application into a Zip file and upload to S3?
sam package
What are some common SAM CLI Commands?
aws sam ___
- build
- deploy
- init
- logs
- publish
- validate
- package
What is the SAM CLI command to check your SAM application for syntax errors?
sam validate