Deploy an IAM role, S3 bucket, and Lambda function as a CloudFormation stack, preview updates safely with a change set, and clean up with delete-stack — from the CLI.
Before writing any template, understand the three core CloudFormation concepts: template, stack, and change set.
No commands in this step — read the explanation before writing the template
A CloudFormation template is a declarative YAML (or JSON) document that describes the desired state of your AWS infrastructure.
You declare what resources you want; CloudFormation figures out the creation order and handles dependencies automatically.
A stack is a live deployment of a template.
Every resource listed in the template becomes a member of the stack.
CloudFormation creates, updates, and deletes resources as a group — if any resource fails to create, the entire stack rolls back automatically.
A change set is a preview of what would change if you applied an updated template to a running stack.
You inspect the change set before executing it, catching destructive replacements before they happen.
Template sections used in this lesson:
- Parameters: user-supplied values that customize the deployment (Stage, ProjectPrefix)
- Resources (required): the actual AWS resources to create
- Outputs: values exported from the stack for easy retrieval (bucket name, function ARN)
No output — this step is conceptual.
Proceed to step 2 to design the capstone architecture.