tag_resource
async
¶
tag_resource(
resource_arn: Arn,
tags: TagList,
*,
config_overrides: Optional[AsyncECRPUBLICClientConfig] = None,
) -> TagResourceResponse
Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource aren't specified in the request parameters, they aren't changed. When a resource is deleted, the tags associated with that resource are also deleted.
Parameters:
-
resource_arn(Arn) –The Amazon Resource Name (ARN) of the resource to add tags to. Currently, the supported resource is an Amazon ECR Public repository.
-
tags(TagList) –The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
Raises:
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
InvalidTagParameterException–An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
-
RepositoryNotFoundException–The specified repository can't be found. Check the spelling of the specified repository and ensure that you're performing operations on the correct registry.
-
ServerException–These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact Amazon Web Services Support.
-
TooManyTagsException–The list of tags on the repository is over the limit. A repository can have up to 50 tags. Remove tags with
UntagResource, or specify fewer tags, then try again. -
UnsupportedCommandException–The action isn't supported in this Region. Check that the action is available in the Amazon Web Services Region that you're using, and try again in a supported Region.
-
UnknownServiceError–The service returned an error code this client does not model.