6

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?

  1. Do I need to modify the task definition?
  2. 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.

2 Answers 2

5

Options are:

  1. 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.
  2. Use CodePipeline to update ECS. It will automatically generate a new task definition revision with the new image and deploy it.
4

If task definition is using "latest" as image tag in container definition,to update ecs service in order to pull new image from ECR with "latest" tag. You can simply do Force new deployment aws ecs update-service --cluster --service --force-new-deployment --profile

All though using "latest" tag for deployment is not good practice

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.