-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to tag tasks? #249
Comments
Hello @karanpratapsingh ! Sorry for the late check-in 🙇🏼♀️ ! This action helps you update an existing ECS service with a task definition. As the starting and stopping of a task is controlled by the ECS service that it runs under, the action itself does not have the ability or permission to tag the tasks. Here are a few suggestions that I have to achieve your goal: Propagate Tags From Service Or Task DefinitionIf you specify Tagging The ServiceYou can also just tag the service, and not the individual tasks. In order to reach the tasks spun up by that service, you can use the Tag Resources ManuallyFinally, you can still opt to tag your individual tasks using the You can find more information about tagging ECS resources here as well. Hope this helps!! |
Thanks for the detailed answer @Lou1415926 , I ended up doing it with cli. Here's the script #!/bin/bash
CLUSTER="$1"
SERVICE="$2"
PLATFORM_TAG="key=platform,value=Fargate"
# Tag new ECS tasks
for ARN in $(aws ecs list-tasks --cluster $CLUSTER --output text --query 'taskArns[*]' --service $SERVICE --no-cli-pager);
do
echo "Tagging ARN: $ARN with $PLATFORM_TAG"
aws ecs tag-resource --resource-arn $ARN --tags $PLATFORM_TAG --no-cli-pager;
done
|
I see that this is an old issue but I would like to ask for your recommendation @Lou1415926 @karanpratapsingh We have deployed our service with terraform and and the majority of our services were created without the We suspect that, because of the Any idea what what approach should I do if I want the tags to persist and I do not want to avoid re-creating the services or using a script each time there is a deployment. Thanks! |
Bumps [eslint](https://github.com/eslint/eslint) from 8.43.0 to 8.44.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.43.0...v8.44.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Looking at the code, I see you use
codedeploy.createDeployment
function which doesn't doesn't allow for tagging task that'll be created like we can do withecs.runTask
...is there a possible approach?The text was updated successfully, but these errors were encountered: