🎯 Learning Objectives
- Understand what AWS CloudFormation is and why it is used
- Learn the structure of a CloudFormation YAML template
- Understand the core building blocks: Parameters, Resources, and Outputs
- Deploy a real VPC stack using the AWS Console
- Inspect the resources that CloudFormation created on your behalf
- Learn how to safely delete a CloudFormation stack
Part 1: What is CloudFormation?
Explanation
AWS CloudFormation is an Infrastructure as Code (IaC) service. Instead of clicking around the AWS Console to create resources, you write a YAML (or JSON) file that describes exactly what you want — and CloudFormation builds it for you automatically.
This approach has major advantages:
- ✅ Repeatable — run the same template in any region or account
- ✅ Version-controlled — store your infrastructure in Git just like code
- ✅ Safe to delete — CloudFormation tracks everything it created, so it can tear it all down cleanly
Key Concepts
- Stack — a single deployment of a CloudFormation template. One template = one stack = a group of related AWS resources.
- Template — the YAML or JSON file describing your desired infrastructure.
- Resource — any AWS object the template creates (VPC, Subnet, EC2, S3 bucket, etc.).