AWS when we have to update task definition

170 Views Asked by At

As a newbie to AWS, I have been updating the task definition file every time when I have to update the service.

Say if I have a Task Definition 1 that has a Docker Image, and if I updated the Docker image, refreshing the service will get the latest docker image?

or do I need to update the Task Definition file to let the service pull the latest docker image?

2

There are 2 best solutions below

0
On

In the AWS ECS, after updating the Docker image, it is necessary to update the task definition and update the relation with the service.

A tool such as ecs-deploy is useful to simplify this type of work. https://github.com/silinternational/ecs-deploy

If you want to update Docker image frequently, you can further automate such as deploying from CI service.

0
On

You could try to use a label within the docker repository like "latest" or "dev" referenced within the task definition.

However, you would not be able to use the update-service deployment orchestration because the task definition version does not change.

With ECS, the task definition version is key to the orchestration of deployments.