Cloudformation does not tag resources


Hello, I am trying to figure out which tags does my CloudFront distribution have (for cost analysis). I am using Cloudformation to deploy the distribution, therefore I expected for distribution to have preconfigured the tags which cloud formation adds automatically (

When checking the tags, I only see "stage" tag.

Why are the tags not added to CloudFront distribution?

PS: I have noticed similar behavior for API gateways as well.

2 Risposte

[Edited] Hi!

The only CLI command to list tags for a CloudFront resource is the command you used list-tags-for-resource :

The Max Retries error you see comes from AWS's CLI - there are maximum numbers of retries built in:

If you are looking for the tags:

  • aws:cloudformation:logical-id
  • aws:cloudformation:stack-id
  • aws:cloudformation:stack-name

These 3 tags are only added at the CloudFormation stack level and you're right - should be propogated to resources that CloudFormation supports (except for right now, EBS volumes).

If you add more resource tags at the CloudFormation level, for example "project" : "Project ABC", that tag will propagate down to resources supported by CFT. In your case, if you are using CloudFormation (, the AWS::CloudFront::Distribution resource.

I would suggest adding a new tag such as "project": "Project ABC" to help with cost attribution. Have you tried that on the CloudFormation stack to see if they propogate? If that doesn't work, interesting find that the tags aren't propagating properly.

con risposta 2 anni fa
  • I am not sure you are completely correct about tagging.

    According to the documentation (link I posted above) :

    All stack-level tags, including automatically created tags, are propagated to resources that CloudFormation supports.

    Also, I am seeing mixed behavior for various resources. When creating lambda the

    • aws:cloudformation:logical-id
    • aws:cloudformation:stack-id
    • aws:cloudformation:stack-name

    are added automatically. When creating Cloudfront distribution I am getting tags that I specify on stack level (during CREATE/UPDATE), but not the aforementioned tags.

  • You're right - I modified the response above. I wonder if it's a bug on the aws:cloudformation:<value> tags.


I think that there is only stage tag then.

For me, CLI command and AWS console shows exactly the same tags :)

One pro tip, never show your AWS Account Id publicly as you did in the CLI command.

profile picture
con risposta 2 anni fa
  • Ok, I have fixed the problem with CLI (I accidentally used the wrong profile).

    Anyways question still is: Why does Cloudformation does not propagate the tags it should

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande