Cloudformation Stack Update Fails Due to Duplicate Tags Errors on IAM Role Resource

0

My stack has some tags that I can see on the "Stack Info" dashboard. The IAM Role resource I am trying to add to the stack does not use any tags. Nevertheless, I get the following error during the stack update at the Role's creation:

Duplicate tag keys found. Please note that Tag keys are case insensitive. (Service: AmazonIdentityManagement; Status Code: 400; Error Code: InvalidInput; Request ID: 2e1c1359-cfa9-4f6b-9571-0b302df35355; Proxy: null)

I don't really know what could be causing this. Thanks for your help!

2개 답변
2
수락된 답변

Hi,

The error message "Duplicate tag keys found. Please note that Tag keys are case insensitive" occurs when there are duplicate tag keys in the IAM Role resource being created, even if the keys have different cases. Check this out:

https://docs.aws.amazon.com/it_it/IAM/latest/UserGuide/access_tags.html

BTW, this error can occur even if the IAM Role resource does not use any tags. To prevent duplicate tags with a key that varies only by case, use the "aws:TagKeys" condition to define the tag keys that your users can apply, or use tag key-name condition key to specify what tag key-value pairs can be passed in a request to tag or untag an AWS resource

You can check all the resources in the stack that have tags defined and verify if any of them have duplicate tag keys. To do this, you can navigate to the CloudFormation console, select your stack, and view the "Resources" tab. From there, you can expand each resource and look for tags.

profile pictureAWS
답변함 일 년 전
profile picture
전문가
검토됨 12일 전
profile picture
전문가
검토됨 19일 전
  • Thank you Stefano. There seems to be duplicate keys in our json config file. Do you know how to define "stack-level" tags inside the yml file?

0

Hi, To define stack-level tags in a CloudFormation YAML file, you can use the Tags property at the root level of your template. Here's an example:

AWSTemplateFormatVersion: '2010-09-09' Description: Your CloudFormation stack description Tags: StackLevelTag1: StackLevelValue1 StackLevelTag2: StackLevelValue2 Resources: ...

Make sure to replace StackLevelTag1, StackLevelValue1, etc. with your actual tag key-value pairs. Remember that stack-level tags are not specific to any particular resource. They are used to provide metadata at the stack level. Also, remember to adjust the resource type (AWS::EC2::Instance in the example) and properties according to your resource's definition.

profile pictureAWS
답변함 일 년 전

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

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

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

관련 콘텐츠