Assign Multiple Values to a Single key tag In AWS

0

I will like to know if it is possible to assign multiple values to a single key tag in AWS, especially for EC2 instances. Kindly advise.

4 Answers
0

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
profile picture
EXPERT
answered 3 years ago
0

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.

profile pictureAWS
EXPERT
answered 2 years ago
0

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.

answered 3 months ago
-1

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?

profile pictureAWS
EXPERT
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions