Deploy applications using blue-green deployment patterns to maintain two identical production environments, enabling instant traffic switching and rapid rollback capabilities.
When to Use
Zero-downtime releases
High-risk deployments
Complex application migrations
Database schema changes
Rapid rollback requirements
A/B testing with environment separation
Staged rollout strategies
Quick Start
Minimal working example:
# blue-green-setup.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: blue-green-config
namespace: production
data:
switch-traffic.sh: |
#!/bin/bash
set -euo pipefail
CURRENT_ACTIVE="${1:-blue}"
TARGET="${2:-green}"
ALB_ARN="arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/myapp-alb/1234567890abcdef"
echo "Switching traffic from $CURRENT_ACTIVE to $TARGET..."
# Get target group ARNs
BLUE_TG=$(aws elbv2 describe-target-groups \
--load-balancer-arn "$ALB_ARN" \
--query "TargetGroups[?Tags[?Key=='Name' && Value=='blue']].TargetGroupArn" \
--output text)
GREEN_TG=$(aws elbv2 describe-target-groups \
--load-balancer-arn "$ALB_ARN" \
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
Guide
Contents
Blue-Green with Load Balancer
Blue-Green with Load Balancer
Blue-Green Rollback Script
Blue-Green Rollback Script
Monitoring and Validation
Monitoring and Validation
Best Practices
✅ DO
Follow established patterns and conventions
Write clean, maintainable code
Add appropriate documentation
Test thoroughly before deploying
❌ DON'T
Skip testing or validation
Ignore error handling
Hard-code configuration values
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: aj-geddes-useful-ai-prompts-blue-green-deployment3description: Blue-Green Deployment4---56# Blue-Green Deployment78## Table of Contents910- [Overview](#overview)11- [When to Use](#when-to-use)12- [Quick Start](#quick-start)13- [Reference Guides](#reference-guides)14- [Best Practices](#best-practices)1516## Overview1718Deploy applications using blue-green deployment patterns to maintain two identical production environments, enabling instant traffic switching and rapid rollback capabilities.1920## When to Use2122- Zero-downtime releases23- High-risk deployments24- Complex application migrations25- Database schema changes26- Rapid rollback requirements27- A/B testing with environment separation28- Staged rollout strategies2930## Quick Start3132Minimal working example:3334```yaml35# blue-green-setup.yaml36apiVersion: v137kind: ConfigMap38metadata:39 name: blue-green-config40 namespace: production41data:42 switch-traffic.sh: |43 #!/bin/bash44 set -euo pipefail4546 CURRENT_ACTIVE="${1:-blue}"47 TARGET="${2:-green}"48 ALB_ARN="arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/myapp-alb/1234567890abcdef"4950 echo "Switching traffic from $CURRENT_ACTIVE to $TARGET..."5152 # Get target group ARNs53 BLUE_TG=$(aws elbv2 describe-target-groups \54 --load-balancer-arn "$ALB_ARN" \55 --query "TargetGroups[?Tags[?Key=='Name' && Value=='blue']].TargetGroupArn" \56 --output text)5758 GREEN_TG=$(aws elbv2 describe-target-groups \59 --load-balancer-arn "$ALB_ARN" \60// ... (see reference guides for full implementation)61```6263## Reference Guides6465Detailed implementations in the `references/` directory:6667| Guide | Contents |68|---|---|69| [Blue-Green with Load Balancer](references/blue-green-with-load-balancer.md) | Blue-Green with Load Balancer |70| [Blue-Green Rollback Script](references/blue-green-rollback-script.md) | Blue-Green Rollback Script |71| [Monitoring and Validation](references/monitoring-and-validation.md) | Monitoring and Validation |7273## Best Practices7475### ✅ DO7677- Follow established patterns and conventions78- Write clean, maintainable code79- Add appropriate documentation80- Test thoroughly before deploying8182### ❌ DON'T8384- Skip testing or validation85- Ignore error handling86- Hard-code configuration values8788---89> Converted and distributed by [TomeVault](https://tomevault.io/claim/aj-geddes) — claim your Tome and manage your conversions.90<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/aj-geddes-useful-ai-prompts-blue-green-deployment in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Blue-Green Deployment It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.