- Newest
- Most votes
- Most comments
Hello
You can't simply, Each key must have Uniq Name, But you can do another way for example
Name-1 Project1
Name-2 Project1
Name-3 Project1
You can have a tag with multiple value field of the tag. An example is mentioned in our documentation.
The example is with the tag 'team', where more than one team is associated to that resource.
team = Engineering:QA
The delimiter is ":", but could be other valid separators. Using this to control for access takes special consideration on how you craft your policy for those values.
I stumbled across the very same challenge and this is what I found:
- You cannot use duplicate keys
- AWS officially supports single values
- You can overcome above limitations providing multiple values as a string with a delimiter
- Allowed characters for most resource types are:
_ . : / = + - @
- Some resource types may have different limitations, e.g. Timestream doesn't support
@
by the docs - Asking Amazon Q may not bring accurate answers regarding limitations - I tried asking and got a set of characters without
/
, which is explicitly mentioned in AWS Console when adding tag values for a role, in Timestream docs and other docs I have found during the research.
So you could use multiple values like this:
TagKey = Value1:Value2:Value3
or
TagKey = Value1+Value2+Value3
or any other separator from this list: _ . : / = + - @
I recommend thinking about a tagging policies you would like to follow first, as if you use e.g. -
as a part of value, it should not then be used as a separator or things will mess up.
And again - AWS doesn't support multiple values - this means that whatever you further do with these values, you need to handle, process and interpret them on your own, e.g. in your custom solution that does something with these tags.
No - single tag, single value. However you might consider using (say) a comma or semicolon as a delimeter and then parsing the tag value. Note that you shouldn't do this for billing tags.
What do you need multiple tag values for?
Relevant content
- asked 5 years ago
- asked 10 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Thanks for your comment. I have an instance hosting more than one application, hence the instance is to have two application IDs for the key name application.
But you can do Key: Application_ID1: ABCD and Application_ID2: ABCD
While it is possible overload a Tag as mentioned in the other comments, it is highly not recommended https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf (see page 11)
Commas and semicolons are not allowed in tag values. As these would be probably the first separators to come in mind, I think it is worth noting that here.
Pipe, although mentioned in the document linked here previously (https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf) as an example, is also not supported - I just tested it for AWS IAM Role.
And various resource types can have different restrictions - e.g. Role supports
@
, but Timestream doesn't mention it in docs: https://docs.aws.amazon.com/timestream/latest/developerguide/TaggingRestrictions.html