Cloudformation tagging for cost management


Can you tag an existing cloudformation resource in the console or cli?

2 Answers

Yes, you can. But it would be best if you updated the cloudformation template to include the tags on the resource(s) and updated the stack with the updated template.

profile pictureAWS
answered 2 years ago

If you want to have unique tag keys or values per resource then the right the way to include tags into template as Kentrad said. But if you want to have tags applied to all resources of the stack, it is much easier to apply tags to stack (via console or cli) and then Cloudformation will automatically apply the tags for all resources. You can also change/add/remove tags of exiting stack by doing an stack update with new tags. Here is an example how to do this

PS. There is a small caveat here, some Cloudformation resources have faulty implementation causing resource to be replaced for tag update. Just pay attention that "Replacement = False" for all resources before applying an update. There are rare cases but TGW is one such example,

profile picture
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions