tag_resource(
resource_arn: Arn,
tags: TagList,
*,
config_overrides: Optional[ACMClientConfig] = None,
) -> None
Adds one or more tags to an ACM resource. Tags are labels that you can use to identify and organize your Amazon Web Services resources. Each tag consists of a key and an optional value.
Use this action for all ACM resource types except the certificate resource type. For certificate resources, use AddTagsToCertificate instead.
To remove one or more tags, use the UntagResource action. To view all of the tags that have been applied to a resource, use the ListTagsForResource action.
Parameters:
-
resource_arn
(Arn)
–
The ARN of the ACM resource to which the tag is to be applied.
-
tags
(TagList)
–
The key-value pair that defines the tag to apply.
Raises:
Source code in docs_src/capo_acm/_services/acm.py
| def tag_resource(
self,
resource_arn: "capo_acm.types.arn.Arn",
tags: "capo_acm.types.tag_list.TagList",
*,
config_overrides: Optional[ACMClientConfig] = None,
) -> None:
"""<p>Adds one or more tags to an ACM resource. Tags are labels that you can use to identify and organize your Amazon Web Services resources. Each tag consists of a <code>key</code> and an optional <code>value</code>.</p> <note> <p>Use this action for all ACM resource types except the <code>certificate</code> resource type. For certificate resources, use <a>AddTagsToCertificate</a> instead.</p> </note> <p>To remove one or more tags, use the <a>UntagResource</a> action. To view all of the tags that have been applied to a resource, use the <a>ListTagsForResource</a> action.</p>
Args:
resource_arn: <p>The ARN of the ACM resource to which the tag is to be applied.</p>
tags: <p>The key-value pair that defines the tag to apply.</p>
Raises:
capo_acm.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
capo_acm.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service quota has been exceeded.</p>
capo_acm.errors.validation_exception.ValidationException: <p>The supplied input failed to satisfy constraints of an Amazon Web Services service.</p>
capo_acm.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_acm.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[None]:
import capo_acm._operations.certificate_manager.tag_resource
output, http_response = (
capo_acm._operations.certificate_manager.tag_resource.tag_resource(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagResource")
)
input_: capo_acm.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|