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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン