amazon-ecs-deploy-task-definition icon indicating copy to clipboard operation
amazon-ecs-deploy-task-definition copied to clipboard

Can I use an existing task-definition instead of creating new?

Open vivekyad4v opened this issue 3 years ago • 7 comments

Use case - Task definitions are managed by Terraform, we do not want the taskdef version to be updated from Github actions.

It's like a force deployment of latest version of an existing task definition in ECS service.

Ref - https://github.com/aws-actions/amazon-ecs-deploy-task-definition/issues/70

vivekyad4v avatar Jan 28 '22 09:01 vivekyad4v

Hi @vivekyad4v, I think this might help?

    - name: Download current task definition
      run: |
        aws ecs describe-task-definition --task-definition ${{ env.ECS_TASK_DEFINITION }} --query taskDefinition > task-definition.json

gopetracca avatar Feb 21 '22 21:02 gopetracca

Any update on this? We have the same issue, where cdk creates a task definition. We download it using the method described above, but ultimately results in two task definitions. One from cdk deploy, and one from the ecs deploy

dsdavis4 avatar Nov 30 '22 22:11 dsdavis4

Any update on this? We have the same issue, where cdk creates a task definition. We download it using the method described above, but ultimately results in two task definitions. One from cdk deploy, and one from the ecs deploy

Similar issue, but looks like no one has chimed in yet with a solution

varunchillara27 avatar Nov 30 '22 22:11 varunchillara27

Using the existing one instead of creating new is really important 'cause the number of revisions per task definition has a limit: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html

liuerfire avatar Dec 21 '22 12:12 liuerfire

Maybe the problem is in this place:

image

It seems that always is registering a new task-definition.

I don't have time right now to fix this, but I can help in a few months '-'

rof20004 avatar Mar 07 '23 00:03 rof20004

What about making the task definition optional? The service update from ECS supports this and uses the active definition for the given service

LucasJC avatar May 15 '23 22:05 LucasJC

Any update on this? We have the same issue.

filipemacedo avatar Sep 11 '23 17:09 filipemacedo