π― What Is Blue-Green Deployment?
Blue-Green deployment maintains two identical production environments:
Blue β currently serving live users
Green β idle environment used for deploying and testing the new version
The deployment flow is simple and powerful:
Deploy the new application version to the idle environment
Test it thoroughly
Swap traffic from Blue β Green
If something goes wrong, swap back instantly
No redeploys. No rebuilds. No panic.
π Architecture Used in Day 17
The project uses the following AWS components:
S3 Bucket β Stores application artifacts (ZIP files)
Elastic Beanstalk Application
Two Elastic Beanstalk Environments
Blue (Production)
Green (Staging / New Version)
IAM Roles & Policies
Terraform IaC to manage everything
Both environments are identical in configuration β only the deployed application version differs.
βοΈ Terraform Deployment Flow
Terraform is used to:
Create the S3 bucket
Upload application versions
Define Elastic Beanstalk application
Create two separate environments
Attach correct IAM roles
Apply autoscaling and health settings
Manage environment variables and tags
Standard Terraform workflow is followed:
terraform init
terraform plan
terraform apply
After apply:
Blue environment runs version 1.0
Green environment runs version 2.0
Both environments are live and accessible via separate URLs
π Swapping Traffic (Blue β Green)
Traffic switching is performed by swapping environment CNAMEs in Elastic Beanstalk.
What happens during swap:
DNS pointers are updated
User traffic moves to the new environment
Old environment becomes idle
No redeployment occurs
Minimal to zero downtime
From a user perspective:
π The application URL stays the same
π The version changes transparently
π Rollback Strategy
Rollback is extremely simple:
Perform another environment swap
Traffic returns to the previous stable version
This is one of the biggest advantages of Blue-Green deployment:
β Rollback is instant
β No rebuild required
β No infrastructure changes
π Conclusion
Day 17 demonstrates how modern deployments are done safely.
By combining:
Terraform (IaC)
Elastic Beanstalk
S3-based versioning
Blue-Green strategy
you get a robust, low-risk deployment workflow suitable for real production systems.
This session clearly shows that Terraform is not just about creating infrastructure β
itβs about operating systems reliably at scale.
Top comments (0)