Blue/Green Deployment (ALB + Route53 Weighted)
AWS architecture template · SAA-C03: Two ALB+ASG stacks (Blue=active, Green=standby). Route53 weighted records swap traffic with zero downtime.
Blue/Green Deployment (ALB + Route53 Weighted) is a free AWS architecture template built with Auto Scaling, EC2, Load Balancer and Route 53. Open it in TheArchitect to edit the diagram, estimate monthly cost, and export the CloudFormation or Terraform that deploys it.
AWS services in this template
- Auto Scaling×2
- EC2×2
- Load Balancer×2
- Route 53
Deployment notes
Needs input
- Deploy Blue stack first; launch Green stack in parallel with new code.
- Switch by updating Route53 weights: Blue Weight→0, Green Weight→255.
- Both ALBs need subnets and security groups configured before deploying.
Generated CloudFormation — 7 resources
| Logical ID | Resource type |
|---|---|
| Route53WeightedDNSroute53 | AWS::Route53::HostedZone |
| BlueALBelb | AWS::ElasticLoadBalancingV2::LoadBalancer |
| BlueASGautoscaling | AWS::AutoScaling::AutoScalingGroup |
| BlueEC2v1ec2 | AWS::EC2::Instance |
| GreenALBelb | AWS::ElasticLoadBalancingV2::LoadBalancer |
| GreenASGautoscaling | AWS::AutoScaling::AutoScalingGroup |
| GreenEC2v2ec2 | AWS::EC2::Instance |
View the full CloudFormation template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Generated by TheArchitect — https://www.thecloudarchitect.dev",
"Metadata": {
"TheArchitect": {
"Edges": [
{
"From": "BlueALBelb",
"To": "BlueASGautoscaling",
"Label": "forward"
},
{
"From": "GreenALBelb",
"To": "GreenASGautoscaling",
"Label": "forward"
}
]
}
},
"Resources": {
"Route53WeightedDNSroute53": {
"Type": "AWS::Route53::HostedZone",
"Properties": {
"HostedZoneConfig": {
"Comment": "Two weighted A records — one per ALB. Swap weights to shift traffic."
}
}
},
"BlueALBelb": {
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
"Properties": {
"Name": "saa-blue-alb",
"Type": "application",
"Scheme": "internet-facing",
"IpAddressType": "ipv4"
}
},
"BlueASGautoscaling": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AutoScalingGroupName": "saa-blue-asg",
"MinSize": "2",
"MaxSize": "6",
"DesiredCapacity": "2",
"HealthCheckType": "ELB",
"HealthCheckGracePeriod": 60
}
},
"BlueEC2v1ec2": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-0c02fb55956c7d316",
"InstanceType": "t3.small"
}
},
"GreenALBelb": {
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
"Properties": {
"Name": "saa-green-alb",
"Type": "application",
"Scheme": "internet-facing",
"IpAddressType": "ipv4"
}
},
"GreenASGautoscaling": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AutoScalingGroupName": "saa-green-asg",
"MinSize": "2",
"MaxSize": "6",
"DesiredCapacity": "2",
"HealthCheckType": "ELB",
"HealthCheckGracePeriod": 60
}
},
"GreenEC2v2ec2": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-0c02fb55956c7d316",
"InstanceType": "t3.small"
}
}
}
}Generated by TheArchitect from the diagram above. Review values such as names, CIDR ranges and instance sizes before deploying to your account.