Creating Your First Stack
You'll learn: How to deploy your very first CloudFormation stack using a template through the AWS Console, CLI, or SDK.
Now that you understand template structure, it's time to bring a template to life by creating a stack—the running instance of your infrastructure defined in the template.
The Stack Creation Process
Think of a stack like baking a cake from a recipe. Your CloudFormation template is the recipe (instructions), and the stack is the actual cake (deployed resources). Each time you use that recipe, you create a new cake—or in AWS terms, a new stack.
Three Ways to Create a Stack
AWS Console (Visual): Navigate to CloudFormation → Create Stack → upload your template file or paste template text → provide a stack name → configure parameters → review and create. AWS validates your template, shows you what will be created, then provisions resources one by one.
AWS CLI (Command-Line):
aws cloudformation create-stack \
--stack-name my-first-stack \
--template-body file://template.yaml
AWS SDK (Programmatic):
Use language-specific SDKs (Python boto3, JavaScript, etc.) to call create_stack() with your template content and parameters.
What Happens During Creation
CloudFormation reads your template, determines resource dependencies, and creates resources in the correct order. You'll see stack status progress from CREATE_IN_PROGRESS to CREATE_COMPLETE (or ROLLBACK_COMPLETE if errors occur). Each resource gets a physical ID that CloudFormation tracks internally.
The stack becomes your management unit—you update, delete, or inspect it as a whole, and CloudFormation maintains the relationship between your template and the actual AWS resources.
Key Takeaway: Creating a stack transforms your CloudFormation template into real, running infrastructure—you can do this through the Console for visibility, CLI for automation, or SDK for programmatic control.