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개 답변

[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.

답변함 2년 전
  • 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
답변함 2년 전
  • 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

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

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

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

관련 콘텐츠