Search⌘ K
AI Features

Infrastructure as Code

Understand how to deploy and update serverless applications using AWS CloudFormation and SAM templates. Learn how infrastructure as code simplifies managing and versioning cloud resources, enabling safe deployments, easy updates, and collaboration.

The CloudFormation template

For deploying applications, SAM uses CloudFormation, an AWS service for managing infrastructure as code. This means that CloudFormation converts a source file describing an application infrastructure (called template) into a set of running, configured cloud resources (called stack).

Instead of individually configuring different resources such as file storage, databases, and queues with CloudFormation, you just need to declare the required resources in a textual file. The template.yaml file in your project directory is a CloudFormation template.

The CloudFormation stack

You can use CloudFormation to create a whole stack of resources from the template in a single command. It is also smart enough to detect the differences between a template and a deployed stack, making it easy to update infrastructure resources in the future.

Benefits of CloudFormation

  • You can modify the template file and CloudFormation will reconfigure or delete only the resources that actually need to change.

  • If a ...