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

Add Ability to fetch the Task Definition Using AWS API for Node and Then Rendering it.

Open mangeshg opened this issue 3 years ago • 8 comments

Currently this workflow expects to have the Task Definition Json to be part of the GitHub Repo.

If this action can be enhanced to fetch the task definition just by using family:revision provided to AWS.ECS. describeTaskDefinition API and then rendering it further , Then Users do not need to check in the task definition Json in the Repo. Optionally - Updated task definition can be registered back using registerTaskDefinition API call with updated ECR Image ID.

This will achieve -

  1. Better user confidence to avoid checking in Spec file containing references to various AWS ARNs (Account Id ) etc.
  2. It will be guaranteed that Task Definition will always be correct / no need to validate its format specs etc.

mangeshg avatar May 18 '21 09:05 mangeshg

@mangeshg Thank you for reporting this feature request to us, we will look into this and get back with the appropriate answer to it.

paragbhingre avatar May 18 '21 18:05 paragbhingre

@paragbhingre Thanks Parag , Looking forward to it.

mangeshg avatar May 19 '21 18:05 mangeshg

I am also waiting for this feature to be available, I am also willing to contribute if someone can guide me through.

pktippa avatar Mar 25 '22 03:03 pktippa

This would be nice. My workaround is to run this step before the render task def step:

    - name: Get current task definition
      run: >
        aws ecs describe-task-definition
        --task-definition "$TASK_FAMILY" --region "$AWS_DEFAULT_REGION" --query 'taskDefinition'
        > task-definition.json

sblack4 avatar Jul 20 '22 17:07 sblack4

Looking forward to this feature!

protonforest avatar Aug 27 '22 03:08 protonforest

describe-task-definition

Good workaround, but the issue with this is that the tags are not pulled into the task definition. And removing the --query 'taskDefinition' and including --include TAGS then means it just fails, as the task def is not in the correct format.

scott-doyland-burrows avatar May 24 '24 13:05 scott-doyland-burrows

describe-task-definition

Good workaround, but the issue with this is that the tags are not pulled into the task definition. And removing the --query 'taskDefinition' and including --include TAGS then means it just fails, as the task def is not in the correct format.

We do the following to get the task definition including tags and then sanitize the definition:

        aws ecs describe-task-definition \
          --task-definition ${{ inputs.task_definition }} \
          --include TAGS > task-definition.json

        jq '
          .taskDefinition.tags += [.tags[]] |
          del(.tags) |
          .taskDefinition |
          del(.compatibilities,
              .registeredAt,
              .registeredBy,
              .revision,
              .requiresAttributes,
              .status,
              .taskDefinitionArn)' task-definition.json > clean-task-definition.json

I am surprised that after 3 years of this being open, AWS hasn't taken any action.

anitakrueger avatar Jun 19 '24 22:06 anitakrueger

Hi @anitakrueger,
Thank you for your patience, I am happy to share that we are currently working on this feature. Stay tuned! I appreciate your motivation to continuously be on the lookout for improving ECS GitHub Actions :-)

shesaave avatar Jun 21 '24 16:06 shesaave