-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to add tags with sam deploy #7050
Comments
Hi @ajithkumar999 thanks for raising the issue. Did you include all your existing tags and new tags in the Aside, I'd suggest you to use example:
|
Hi @hawflau, thanks for looking into this issue |
I've tried to reproduce the issue you mentioned. I've created stack with |
Hello @mndeveci |
Hi, just want to reiterate to make sure I'm not getting anything wrong; if I had had deployed tags This currently isn't possible since the difference in tags is compared in Cloudformation, not the underlying deployed resources. Since the tags were never modified in the Cloudformation stack, Cloudformation reports that there is nothing to do. The behaviour you see when you update a tag (eg. You could utilize the AWS CLI or the AWS SDK in the language of your choice to update tags for individual resources, but getting Cloudformation to "reapply" tags won't be possible. |
Closing issue as Cloudformation doesn't actually check tags in the underlying resources when updating. Feel free to create a new issue for anything else you might discover. |
|
Hi @lucashuy,
Sorry, I should have been more specific in my previous reply. Here’s the exact scenario of what I am facing. Day 1: Deploy stack with tags Day 2: Manually delete Day 3: add |
This would still be Cloudformation specific behaviour that you'd unfortunately come across. Cloudformation won't reapply any tags since it won't do any comparisons against the underlying resources in a stack. While its true that Lambda does not have |
Hi @lucashuy, So just to confirm, cloudformation only requests new tag additions for underlying resources. That is, since |
Hello @lucashuy |
Hi, sorry about the delay and back and forth. It looks like the behaviour is that if anything is to change on the stack's tags, all the tags are going to be applied to each of the resources in the stack. So in the previous example that you've noted with the new Checking with a sample app shows that all tags are reapplied on any difference, whether that be a new tag or updated tag. |
Hello,
we are using SAM to deploy our cloud formation template, we are passing --tags along with the SAM deploy command to add tags for all the resources present in the template in one go.
I noticed a few tags were missing on the API gateway resource level, I want to reassign the tags through SAM deploy only, I added a new tag in the SAM deploy command, but it added only that particular tag. it didn’t add the old tags.
my sam deploy command:
sam deploy \ --template-file template.yml \ --stack-name $ENV_NAME-$APP_NAME \ --capabilities CAPABILITY_NAMED_IAM \ --region $AWS_REGION \ --role-arn $CFN_ROLE_ARN \ --parameter-overrides Env=$ENV_NAME BuildArtifactName=$GO_PIPELINE_LABEL Application=$APP_NAME LogLevel=$log_level \ --s3-bucket <bucket_name> \ --s3-prefix $APP_NAME \ --no-fail-on-empty-changeset \ --tags \ env=$ENV_NAME \ dept=abc \ squad=abc \ product=abc \ audience=abc \ client_code=abc \ sensitive_data=true \ Application=$APP_NAME \ team=abc
--> added newlybut only a few tags were present currently, I want to re-add all these tags back to the resource
The text was updated successfully, but these errors were encountered: