Infrastructure as Code – the AWS Serverless Application Model (AWS SAM)
Representing your infrastructure as code brings many benefits in terms of the auditability, automatability, and repeatability of managing the creation and modification of infrastructure. Even though you don’t need to manage any infrastructure when building a serverless application, many components play a role in the architecture: IAM roles, Lambda functions and their configurations, their event sources, and other dependencies. Representing all of these things in AWS CloudFormation natively would require a large amount of JSON or YAML. Much of it would be almost identical from one serverless application to the next.
The AWS Serverless Application Model (AWS SAM) enables you to have a simpler experience
when building serverless applications and get the benefits of infrastructure as code.
AWS SAM
There is a distinction, however, between changes that occur at the infrastructure/environment level and application code changes occurring within existing Lambda functions. AWS CloudFormation and AWS SAM aren’t the only tools required to build a deployment pipeline for your Lambda function code changes. See the CI/CD section of this whitepaper for more recommendations about managing code changes for your Lambda functions.