File tree Expand file tree Collapse file tree 7 files changed +47
-4
lines changed
aws/cloudformation/ecs-zero-downtime-deployment Expand file tree Collapse file tree 7 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 11# Overview
22
3- ![ ECS in two public subnets ] ( ecs-in-two-public-subnets.svg )
3+ ![ ECS Zero Downtime Deployment ] ( ecs-in-two-public-subnets.svg )
44
55# Companion Blog Post
66
7- [ The AWS Journey Part 2: Deploying a Docker image from the Command Line with CloudFormation] ( https://reflectoring.io/aws-cloudformation-deploy-docker-image / )
7+ [ The AWS Journey Part 4: Zero-Downtime Deployment with CloudFormation and ECS ] ( https://reflectoring.io/aws-cloudformation-ecs-deployment / )
88
Original file line number Diff line number Diff line change 1+ # Turning off the AWS pager so that the CLI doesn't open an editor for each command result
2+ export AWS_PAGER=" "
3+
4+ aws cloudformation create-change-set \
5+ --change-set-name update-reflectoring-ecs-zero-downtime-deployment-service \
6+ --stack-name reflectoring-ecs-zero-downtime-deployment-service \
7+ --use-previous-template \
8+ --parameters \
9+ ParameterKey=StackName,ParameterValue=reflectoring-ecs-zero-downtime-deployment-network \
10+ ParameterKey=ServiceName,ParameterValue=reflectoring-hello-world \
11+ ParameterKey=ImageUrl,ParameterValue=docker.io/reflectoring/aws-hello-world:v4 \
12+ ParameterKey=ContainerPort,ParameterValue=8080 \
13+ ParameterKey=HealthCheckPath,ParameterValue=/hello \
14+ ParameterKey=HealthCheckIntervalSeconds,ParameterValue=90
15+
16+ aws cloudformation describe-change-set \
17+ --stack-name reflectoring-ecs-zero-downtime-deployment-service \
18+ --change-set-name update-reflectoring-ecs-zero-downtime-deployment-service
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ aws cloudformation create-stack \
1414 --parameters \
1515 ParameterKey=StackName,ParameterValue=reflectoring-ecs-zero-downtime-deployment-network \
1616 ParameterKey=ServiceName,ParameterValue=reflectoring-hello-world \
17- ParameterKey=ImageUrl,ParameterValue=docker.io/reflectoring/aws-hello-world:latest \
17+ ParameterKey=ImageUrl,ParameterValue=docker.io/reflectoring/aws-hello-world:v3 \
1818 ParameterKey=ContainerPort,ParameterValue=8080 \
1919 ParameterKey=HealthCheckPath,ParameterValue=/hello \
2020 ParameterKey=HealthCheckIntervalSeconds,ParameterValue=90
Original file line number Diff line number Diff line change 1+ # Turning off the AWS pager so that the CLI doesn't open an editor for each command result
2+ export AWS_PAGER=" "
3+
4+ aws cloudformation execute-change-set \
5+ --stack-name reflectoring-ecs-zero-downtime-deployment-service \
6+ --change-set-name update-reflectoring-ecs-zero-downtime-deployment-service
7+
8+ aws cloudformation wait stack-update-complete --stack-name reflectoring-ecs-zero-downtime-deployment-service
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ Resources:
100100 Memory : !Ref 'ContainerMemory'
101101 Image : !Ref 'ImageUrl'
102102 PortMappings :
103- - ContainerPort : !Ref 'ContainerPort' serve
103+ - ContainerPort : !Ref 'ContainerPort'
104104 LogConfiguration :
105105 LogDriver : ' awslogs'
106106 Options :
Original file line number Diff line number Diff line change 1+ # Turning off the AWS pager so that the CLI doesn't open an editor for each command result
2+ export AWS_PAGER=" "
3+
4+ IMAGE_URL=$1
5+
6+ aws cloudformation update-stack \
7+ --stack-name reflectoring-ecs-zero-downtime-deployment-service \
8+ --use-previous-template \
9+ --parameters \
10+ ParameterKey=StackName,ParameterValue=reflectoring-ecs-zero-downtime-deployment-network \
11+ ParameterKey=ServiceName,ParameterValue=reflectoring-hello-world \
12+ ParameterKey=ImageUrl,ParameterValue=$IMAGE_URL \
13+ ParameterKey=ContainerPort,ParameterValue=8080 \
14+ ParameterKey=HealthCheckPath,ParameterValue=/hello \
15+ ParameterKey=HealthCheckIntervalSeconds,ParameterValue=90
16+
17+ aws cloudformation wait stack-update-complete --stack-name reflectoring-ecs-zero-downtime-deployment-service
You can’t perform that action at this time.
0 commit comments