Cloudformation tagging for cost management

0

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

2개 답변
1

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
전문가
kentrad
답변함 2년 전
0

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 https://carriagereturn.nl/aws/cloudformation/tag/2018/04/24/cloudformationtags.html

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, https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-transitgateway/issues/124

profile picture
전문가
Kallu
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인