% docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
182101634518.dkr.ecr.ap-southeast-1.amazonaws.com/foo-bar-ecs v2 e985d8be7124 30 seconds ago 22.6MB
foo-bar-ecs latest e985d8be7124 30 seconds ago 22.6MB
182101634518.dkr.ecr.ap-southeast-1.amazonaws.com/foo-bar-ecs v1 df741806e96f 9 minutes ago 22.6MB
Let's create a revision of the Task Definition being used and tell ECS to use the new task set Container Image URI: V2
- Go to AWS Console > ECS > ECS Task Definitions > Check the box beside "foo-bar-ecs" > Create new revision
- Scroll down > Container Definitions > Click on Container Name "foo-bar-ecs"
- Replace Image from "v1" to "v2" > Scroll Down Click Update and Create
Update ECS service to use new Task Definition revision and trigger a CodeDeploy linear deployment.
- Go to AWS Console > ECS Cluster Console > Services > Check the box beside "foo-bar-ecs" > Click Update
- Select Revision latest > Click on Next Step, Accept all Defaults > Update Service
- Observe linear deployment: AWS Console > CodeDeploy Console > Deployments
- Validate using Browser: http://foo-bar-alb-1797939265.ap-southeast-1.elb.amazonaws.com/
Part 3: Rollback
Let's redeploy v1
- Go to AWS Console > ECS Cluster Console > Services > Check the box beside "ecs-blog-svc" > Click Update
- Select Revision 1 > Click on Next Step, Accept all Defaults > Update Service
- Observe linear deployment: AWS Console > CodeDeploy Console > Deployemnts
- Validate using Browser: http://foo-bar-alb-1797939265.ap-southeast-1.elb.amazonaws.com/