25. Serverless Application Model (SAM) Flashcards
What is SAM?
A framework for developing and deploying serverless applications
Generate complex CloudFormation from a simple SAM YAML file
What AWS services can SAM help you to run locally?
Lambda, API Gateway, DynamoDB
What header indicates a SAM template?
Transform: ‘AWS::Serverless-2016-10-31’
What template code is used for Lambda?
AWS::Serverless::Function
What template code is used for API Gateway?
AWS::Serverless::Api
What template code is used for DynamoDB?
AWS::Serverless::SimpleTable
What are the CLI commands to package and upload to S3 to generate a CF template?
> aws cloudformation package
OR
> sam package
What are the CLI commands to deploy to CloudFormation?
> aws cloudformation deploy
OR
> sam deploy
SAM is built on what other service?
CloudFormation
SAM requires which two template sections?
Transform and Resources sections
Resources is required for any CloudFormation template
What is the CLI command to fetch dependencies and create local deployment artifacts?
> sam build
What are the supported SAM resource types?
- AWS::Serverless::Api
- AWS::Serverless::Application
- AWS::Serverless::Function
- AWS::Serverless::HttpApi
- AWS::Serverless::LayerVersion
- AWS::Serverless::SimpleTable
- AWS::Serverless::StateMachine