Step 1. Create resources by using cloudformation template
- Click
Next
- Click
Next
- Click
Submit
- Wait until
Create_Complete
Step 2. Configure the blue deployment
- Click
Target Groups
- Click
Blue
- Click
Register targets
- Select
Blue EC2and ClickInclude as pending below
- Click
Register pending targets
- Wait
Health statusas Healthy
- Click
Load Balancer
- Click
BlueGreenALB
- Click
1 rule
- Check that the Forward to value is Blue: 100 (100%).
- Click
BlueGreenALB
- Copy DNS and paste in new tab
Step 3. Configure the green deployment
- Click
Target Groups
- Click
Green
- Click
Register targets
- Choose
Green EC2
- Click
Register pending targets
- Click
Load Balancer
- Click
BlueGreenALB
- Select
HTTP:80and ClickManage rulesandEdit rules
- Select
Defaultand ClickActionsandEdit rule
- Click
Add target group
- Choose
Greenand UpdateWeightand ClickSave change
- Click
Refresh Icon
- Click
BlueGreenALB
- Copy DNS and paste in new tab
- If stable, change weight to
50%and test DNS again
Step 4. Change route all traffic to the Green target group by using a CloudFormation change set
- In the AWS Management console, on the navigation bar, type and select the
CloudFormationservice.
- Select
Blue-Green-and-Canary-Deploymentand clickStack actionsandCreate change set for current stack
- Choose
Edit in Application Composerand ClickEdit in Application Composer
- Click
Go to Desinger
- Select and delete the
BlueWebServer1andBlueWebServer2resources.
- In the
BlueGreenALBListenerresource, inTargetGroupArn, change the value to!Ref GreenTargetGroup.
- Delete
BlueTargetGroup
- Click
Refresh,ValidateandSaveIcon
- Select
Replace existing templateand ClickNext
- Write
RemoveBlueEC2andTargetGroupand ClickNext
- Click
Next
- Click
Submit
- Check In the
Changessection,the change will remove theBlueTargetGroup, BlueWebServer1, and BlueWebServer2resources, and modify theBlueGreenALBListener.
- Click
Execute change set
- Click
Execute change setand Wait untilUpdate_Complete
- Click
Load Balancer
- Click
BlueGreenALB
- Copy DNS and paste in new tab
Resources & Next Steps
- 📦 Full Code Repository: AWS Learning Labs - Get the complete, working code from this post
- 📖 More Deep Dives: Whispering Cloud Insights - Read other technical articles
- 💬 Join Discussion: DEV Community - Share your thoughts and questions
- 💼 Let's Connect: Linkedin - I'd love to connect with you





























































Top comments (0)