Understanding the differences between AWS SAM and CloudFormation
First of all, an AWS SAM template is designed to be used with serverless applications and services. At the time of writing, the AWS SAM template reference supports the following resource types:
AWS::Serverless::API
: Creates an API gateway and related resourcesAWS::Serverless::Application
: Creates a serverless applicationAWS::Serverless::Function
: Creates a Lambda function and related resourcesAWS::Serverless::HttpApi
: Creates an HTTP API gateway and related resourcesAWS::Serverless::LayerVersion
: Creates a Lambda layerAWS::Serverless::SimpleTable
: Creates a simplified DynamoDB table (only a primary key without a sort key)
It is still possible to combine CloudFormation’s resources with AWS SAM’s resources. For example, if we want to create an S3 bucket with SimpleTable
, we can do so by adding the CloudFormation resource, as in the following code:
Transform: AWS:...