SAM - Serverless Application Module
Build Serverless architecture in AWS
Build Serverless Application deployments,
templatized serverless application, provides shorthand syntax
The declaration Transform: AWS::Serverless-2016-10-31 is required for AWS SAM template files, Transform is what identifies it as AWS SAM template instead of CloudFormation template
Others include , Globals, Resources, and Parameters
sam package, sam deploy serverless application
CloudFormation package , then CloudFormation deploy
SAM is extension to CloudFormation, and is more simpler.
Deployment packages are stored in S3
Rolls back the deployment if CloudWatch alarms are triggered
Deployment Preference Type
Canary – 2 Increments ( ex: 10% and 90% or 35% and 65%)
Linear - equal increments , equal min
All-at-once – All at once.
AWS::Serverless::Application : Define a Nested application
AWS::Serverless::Function : Creating a Lambda function
AWS::Serverless::LayerVersion : Creating a Lambda layers
AWS::Serverless::Api : Describes an API Gateway resource
AWS::Serverless::HttpApi : Creates an Amazon API Gateway HTTP API
AWS::Serverless::StateMachine : Creates AWS Step Functions state machine
SAM has its own cli (different from aws cli)
sam init : Initialize a serverless application with SAM template
sam validate : validate SAM template
sam build : Builds serverless application
sam package: Bundle you application code and its dependencies into deployment package
sam deploy : Deploy SAM application to AWS