Green-Blue Deployment via Route 53
ยท 2 min read
Green-Blue deployment is a strategy where you have two versions of your application:
- Blue (current stable version)
- Green (new version)
With Route 53, you can implement this using a simple DNS switch.
๐ How to Set It Upโ
-
Deploy two versions of your application
- Run two environments (e.g., EC2 instances, ECS services, or ALBs) with different versions.
-
Create two DNS records in Route 53
blue.example.com
โ Old versiongreen.example.com
โ New version
-
Set up the main DNS record
- Create a CNAME record
app.example.com
pointing to the current stable version (blue.example.com
).
- Create a CNAME record
-
Switch to the new version
- Once the new version is ready, update
app.example.com
to point togreen.example.com
.
- Once the new version is ready, update
-
Rollback if needed
- If something goes wrong, simply switch back to
blue.example.com
.
- If something goes wrong, simply switch back to
โณ Minimal TTL for Faster Updatesโ
To reduce switching delays, set a low TTL (e.g., 60 seconds) on your DNS records. This ensures changes propagate quickly when you update Route 53.
๐ Pros: Simple setup, quick rollback, no complex tools required.
โ Cons: DNS propagation depends on TTL, no automated testing before switching.
This method is ideal for deployments where occasional manual updates are acceptable.