Organizations.Client.
tag_resource
(**kwargs)¶Adds one or more tags to the specified resource.
Currently, you can attach tags to the following resources in Organizations.
This operation can be called only from the organization's management account.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
ResourceId='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The ID of the resource to add a tag to.
You can specify any of the following taggable resources.
ou-
and looks similar to: ou-1a2b-34uvwxyz
r-
and looks similar to: r-1a2b
p-
andlooks similar to: p-12abcdefg3
[REQUIRED]
A list of tags to add to the specified resource.
For each tag in the list, you must specify both a tag key and a value. The value can be an empty string, but you can't set it to null
.
Note
If any one of the tags is not valid or if you exceed the maximum allowed number of tags for a resource, then the entire request fails.
A custom key-value pair associated with a resource within your organization.
You can attach tags to any of the following organization resources.
The key identifier, or name, of the tag.
The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.
None
Exceptions
Organizations.Client.exceptions.AccessDeniedException
Organizations.Client.exceptions.ConcurrentModificationException
Organizations.Client.exceptions.AWSOrganizationsNotInUseException
Organizations.Client.exceptions.TargetNotFoundException
Organizations.Client.exceptions.ConstraintViolationException
Organizations.Client.exceptions.InvalidInputException
Organizations.Client.exceptions.ServiceException
Organizations.Client.exceptions.TooManyRequestsException