Cloudformation tagging for cost management

0

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

2 Respuestas
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
EXPERTO
kentrad
respondido hace 2 años
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
EXPERTO
Kallu
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas