AWS CloudFormation is Amazon Web Services’ service for modeling and provisioning cloud resources from declarative templates. The CloudFormation user guide describes it as a service that helps you “model and set up your AWS resources so that you can spend less time managing those resources and more time focusing on your applications.” Rather than creating and wiring up resources one at a time through the console, a user writes a template that describes all the resources they want, and CloudFormation provisions and configures them, including working out the dependencies between resources.
CloudFormation was introduced on February 25, 2011, making it one of the earliest mainstream infrastructure-as-code offerings, predating Terraform by several years. The launch shipped with sample templates demonstrating how to deploy common applications such as blogs and wikis, and at introduction it covered most of the AWS services then available, spanning dozens of resource types. It established the template-driven, declarative pattern within the AWS ecosystem.
Templates are authored in JSON or, later, YAML. A template enumerates resources and their properties, and can accept parameters, define outputs, and reference other resources so that values like an instance’s generated ID flow automatically into dependent resources. CloudFormation organizes provisioned resources into a unit called a stack, which can be created, updated, or deleted as a whole. This makes an entire environment reproducible and disposable, aligning with immutable-infrastructure practice.
A key property of CloudFormation is that it tracks the state of the resources it manages internally, as part of the stack, so users do not manage a separate state file the way some other tools require. Because it is operated by AWS and integrated tightly with the platform’s APIs and permissions, CloudFormation became the native, first-party way to do infrastructure as code on AWS, and a major influence on the cross-cloud tools that followed.