Remove boolean check for underscore in IAM role (#38664)

Underscore is a valid character in an IAM role, per the docs https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html
pull/38731/head
Vinay Dandekar 7 years ago committed by Ryan Brown
parent ed25b56772
commit bed5f7317d

@ -458,7 +458,7 @@ class Ec2Metadata(object):
new_fields = {}
for key, value in fields.items():
split_fields = key[len(uri):].split('/')
if len(split_fields) == 3 and split_fields[0:2] == ['iam', 'security-credentials'] and '_' not in split_fields[2]:
if len(split_fields) == 3 and split_fields[0:2] == ['iam', 'security-credentials']:
new_fields[self._prefix % "iam-instance-profile-role"] = split_fields[2]
if len(split_fields) > 1 and split_fields[1]:
new_key = "-".join(split_fields)

Loading…
Cancel
Save