Only count user-assigned tags for TagLimitExceeded
According to http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html "Reserved prefix—aws: AWS-assigned tag names and values are automatically assigned the aws: prefix, which the user cannot assign. AWS-assigned tag names do not count towards the tag limit of 10. User-assigned tag names have the prefix user: in the Cost Allocation Report."
This commit is contained in:
parent
519b8e59aa
commit
c94f49cc1e
1 changed files with 2 additions and 2 deletions
|
|
@ -774,9 +774,9 @@ class TagBackend(object):
|
|||
raise InvalidParameterValueErrorTagNull()
|
||||
for resource_id in resource_ids:
|
||||
if resource_id in self.tags:
|
||||
if len(self.tags[resource_id]) + len(tags) > 10:
|
||||
if len(self.tags[resource_id]) + len([tag for tag in tags if not tag.startswith("aws:")]) > 10:
|
||||
raise TagLimitExceeded()
|
||||
elif len(tags) > 10:
|
||||
elif len([tag for tag in tags if not tag.startswith("aws:")]) > 10:
|
||||
raise TagLimitExceeded()
|
||||
for resource_id in resource_ids:
|
||||
for tag in tags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue