The Question That Started It All
"How would you feel if I told you that AWS has a tool to help you deploy workloads to different environments without the fear of production and dev environment clashing?"
That's the question I asked myself early in my cloud journey.
The answer?
It completely transformed how I design, deploy, and manage cloud infrastructure.
That tool is AWS CloudFormation — and if you're not using it yet, you're leaving money (and sleep) on the table.
The Problem: Environment Clashes
We've all been there:
- Dev works perfectly → deploy to prod → everything breaks 😱
- Configuration drift between environments
- "It works on my machine" but not in the cloud
- Manual changes that never make it back to the template
CloudFormation eliminates all of that.
With CloudFormation, the same template defines all environments. What runs in dev is structurally identical to what runs in prod — only the parameters change.
Parameters:
Environment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Resources:
MyEC2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: !If
- IsProd
- t3.medium
- t3.micro
Tags:
- Key: Environment
Value: !Ref Environment
No more manual misconfigurations.
No more "but it worked in dev."
Just clean, predictable deployments.
I Don't Manage Lifecycles — CloudFormation Does
One of the biggest misconceptions is that CloudFormation is "just a templating tool."
It's so much more.
CloudFormation orchestrates the entire lifecycle:
| Operation | What CloudFormation Does |
|---|---|
| Create | Provisions resources in the correct order with dependencies |
| Update | Shows you a change set before applying (no surprises) |
| Rollback | Automatically reverts to the last good state if an update fails |
| Delete | Removes everything it created — no orphans left behind |
This means I spend less time firefighting and more time building actual features.
💰 Delete with Confidence, Pay for Nothing Unused
Here's the part I love:
You can delete a stack and be sure you will not be paying for undeleted resources.
How many times have you found:
- Forgotten EBS volumes accumulating charges 💸
- Orphaned load balancers from old tests
- S3 buckets still running months after a project ended
CloudFormation tracks everything it creates.
When you delete the stack, it cleans up after itself completely.
Real example
A company was running a staging environment that was never cleaned up.
Monthly cost: $847 for unused resources.
After migrating to CloudFormation:
# One command to delete everything
aws cloudformation delete-stack --stack-name staging-env
Monthly cost: $0 for that environment.
We saved over $10,000 annually just by using CloudFormation properly.
Built-in Governance Without Extra Tooling
CloudFormation helps you apply governance without needing a separate policy engine:
✅ Deploy resources to the right AWS regions
✅ Use only approved instance types and sizes
✅ Enforce tagging for cost allocation
✅ Prevent accidental exposure of sensitive resources
Example: Restricting EC2 Instance Types
Rules:
InstanceTypeRule:
Assertions:
- Assert:
!Contains
- [t2.micro, t3.micro, t3.small]
- !Ref InstanceType
AssertDescription: "Only approved instance types are allowed"
Using AWS Service Catalog on top of CloudFormation, organizations can give developers self-service access to pre-approved, governed stacks.
This saves time for engineers and unnecessary cost for the business.
JSON or YAML: Your Choice, Same Power
CloudFormation supports JSON or YAML templates.
This is a deliberate and powerful choice.
Why?
Because it keeps you up to date with Infrastructure as Code (IaC) best practices:
- Version control your infrastructure (Git)
- Review changes via pull requests
- Apply CI/CD pipelines to infrastructure changes
- Use the same mindset across CloudFormation and Terraform
My personal journey
I started with CloudFormation → moved to Terraform → and now use both depending on the use case.
The skills transfer directly:
| CloudFormation | Terraform |
|---|---|
| YAML/JSON templates | HCL configuration |
| Change sets | Plan command |
| Stack sets | Workspaces |
| Drift detection | State management |
Learning CloudFormation didn't slow me down — it made me a better IaC engineer across the board.
🎯 Why This Matters
When you read this, here's what I want you to see:
🚀 I don't just "use AWS" — I design for safety, cost control, and automation
💰 I understand cloud economics — unmanaged resources cost real money
🧠 I embrace IaC as a discipline — not a buzzword, but a daily practice
📈 I think long-term — governance and compliance are built in, not bolted on
"The best infrastructure is the one you can delete without fear."
🔧 Quick Wins: Start Small
If you're new to CloudFormation, don't try to rewrite everything overnight.
Start with:
- One resource — deploy a single S3 bucket
- Add parameters — make it reusable
- Add outputs — see what CloudFormation returns
- Add a change set — preview before applying
- Delete and recreate — prove you can clean up
Sample Starter Template
AWSTemplateFormatVersion: "2010-09-09"
Description: "My First CloudFormation Stack"
Parameters:
BucketName:
Type: String
Description: "Name of the S3 bucket"
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref BucketName
VersioningConfiguration:
Status: Enabled
Outputs:
BucketArn:
Description: "ARN of the created bucket"
Value: !GetAtt MyBucket.Arn
One stack. One resource. Zero fear.
My Thoughts
If you're still managing AWS resources manually or clicking around the console:
Stop. Right now.
Learn CloudFormation (or Terraform).
Start with one stack.
Then another.
Then another.
Not only will you sleep better at night — but recruiters and hiring managers will notice the difference between someone who "knows AWS" and someone who builds safe, accountable, cost-aware cloud systems.
📚 Resources for Further Learning
| Resource | Link |
|---|---|
| AWS CloudFormation User Guide | docs.aws.amazon.com/cloudformation |
| AWS Well-Architected Framework | wa.aws.amazon.com |
| CloudFormation vs Terraform | Blog post coming soon! |
| AWS Service Catalog | aws.amazon.com/servicecatalog |
💬 Let's Connect
I'd love to hear your experiences with CloudFormation!
- Are you using CloudFormation or Terraform?
- What's your biggest IaC challenge?
- What cloud cost horror stories do you have?
Drop a comment below 👇 or connect with me on LinkedIn or Dev.to.
https://www.linkedin.com/in/valentine-stephen
https://github.com/blessador












