Infrastructure as Code
In this lesson, you will learn about the Cloudformation template and the CloudFormation stack. Additionally, you’ll get a detailed look at the `template.yaml` of the project you initialized.
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.