patterndockerMinor
Update ECS task definition with new image from ECR
Viewed 0 times
definitionimageupdatenewecswithecrfromtask
Problem
I have an ECS cluster/service/task definition using an image from my ECR repository.
Let's say I update the image with a new version, will ECS pick the changes automatically?
My goal is to automate the deployment to ECS. I'm not sure if using CodeBuild to build and push the new image to ECR is enough, or if I need something else (codepipeline?) to deploy changes to ECS.
Note: task definition is using "latest" image tag, new images update that tag in ECR.
Let's say I update the image with a new version, will ECS pick the changes automatically?
- Do I need to modify the task definition?
- Do I need to somehow reload/restart the task(s)?
My goal is to automate the deployment to ECS. I'm not sure if using CodeBuild to build and push the new image to ECR is enough, or if I need something else (codepipeline?) to deploy changes to ECS.
Note: task definition is using "latest" image tag, new images update that tag in ECR.
Solution
Options are:
- Use CodeBuild to push the new image. Make sure the task definition is using the "latest" tag. You'll need to force the deployment of the task definition to pick the new image.
- Use CodePipeline to update ECS. It will automatically generate a new task definition revision with the new image and deploy it.
Context
StackExchange DevOps Q#7973, answer score: 5
Revisions (0)
No revisions yet.