

- Write a template that declares the AWS resources you need (for example, EC2 instances, RDS databases, VPCs, subnets).
- Submit that template to AWS CloudFormation.
- CloudFormation provisions and configures the resources automatically, tracking them as a single unit called a stack.
.json, .yaml, or .yml extensions. Templates group resources into a stack; you manage all the resources through stack operations (create, update, delete). When you update a template and submit it again, CloudFormation creates a change set showing what will be added, modified, or removed—so you can review changes before they are applied.
Tip: Use
aws cloudformation validate-template and linters (like cfn-lint) to catch syntax errors and common issues before submitting templates to CloudFormation.
Change sets are a crucial safety feature: always review a change set before executing it. Unreviewed changes may delete or modify resources that other systems depend on.
- Infrastructure as Code (IaC): Templates express your infrastructure as code that can be reviewed and version-controlled.
- Consistent and Repeatable Deployments: The same template produces the same architecture across environments.
- Resource Tracking: CloudFormation knows which resources belong to a stack and manages their lifecycle.
- Version Control and Auditing: Store templates in Git-like systems for history, code review, and rollback.
- Time and Cost Efficiency: Automation reduces manual work and human error, accelerating provisioning.

- AWS CloudFormation documentation
- AWS CloudFormation User Guide — Change sets
- cfn-lint tool (CloudFormation linter)