question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Way to simply update the container name and tag in task definition

See original GitHub issue

CircleCi orb has a way to only update the container name and/or tag without requiring the whole json task definition https://circleci.com/orbs/registry/orb/circleci/aws-ecs (see container-image-name-updates)

This isn’t supported with this action right?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
alex-benoitcommented, Feb 5, 2020

@clareliguori thanks for the quick response

What would be the recommended approach for ENV variables that are defined in the task definition then?

0reactions
alex-benoitcommented, Feb 11, 2020

ended up doing this instead of using the action to avoid having to use a repeated task definition json in the repo (it pulls the latest one from ECS)

LATEST_TASK_DEFINITION=`aws ecs describe-task-definition --task-definition XYZ` NEW_TASK_DEFINTIION=`echo $LATEST_TASK_DEFINITION | jq '.taskDefinition | .containerDefinitions[0].image = "${{ secrets.ECR_REPOSITORY_URL }}:${{ github.sha }}" | del(.["taskDefinitionArn", "revision", "status", "requiresAttributes", "compatibilities"])'` TASK_DEFINITION_REVISION=`aws ecs register-task-definition --cli-input-json "$NEW_TASK_DEFINTIION" | jq '.taskDefinition.revision'` aws ecs update-service --cluster XYZ --service XYZ --task-definition XYZ:${TASK_DEFINITION_REVISION}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Updating a task definition using the classic console
To update a task definition, create a task definition revision. If the task definition is used in a service, you must update that...
Read more >
Update the container of a service in Amazon ECS - Server Fault
Upload your new container:tag to the repository · Create a new task definition referencing the new tag · Update your service to reference...
Read more >
How do I deploy updated Docker images to Amazon ECS tasks?
Navigate to Task Definitions · Select the correct task · Choose create new revision · If you're already pulling the latest version of...
Read more >
Task definition parameters - Amazon Elastic Container Service
The following task definition parameters are either required or used in most container definitions. Topics. Name; Image; Memory; Port mappings. Name. name. Type ......
Read more >
circleci/aws-ecs@3.2.0
Use this to update the Docker image names and/or tag names of existing containers that had been defined in the previous task definition....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found