Assigns tags to resources. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value, both of which you define. Tags enable you to categorize your Amazon Web Services resources by attributes such as purpose, owner, or environment. When you have many resources of the same type, you can quickly identify a specific resource based on the tags you've assigned to it.
Parameters:
-
resource_arn
(ResourceArn)
–
The Amazon Resource Name (ARN) that identifies the resource to list the tags for. Currently, the supported resources are Amazon EMR Serverless applications and job runs.
-
tags
(TagMap)
–
The tags to add to the resource. A tag is an array of key-value pairs.
Raises:
Source code in docs_src/capo_emr_serverless/_services/async_emr_serverless.py
| async def tag_resource(
self,
resource_arn: "capo_emr_serverless.types.resource_arn.ResourceArn",
tags: "capo_emr_serverless.types.tag_map.TagMap",
*,
config_overrides: Optional[AsyncEMRServerlessClientConfig] = None,
) -> "capo_emr_serverless.types.tag_resource_response.TagResourceResponse":
"""<p>Assigns tags to resources. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value, both of which you define. Tags enable you to categorize your Amazon Web Services resources by attributes such as purpose, owner, or environment. When you have many resources of the same type, you can quickly identify a specific resource based on the tags you've assigned to it. </p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) that identifies the resource to list the tags for. Currently, the supported resources are Amazon EMR Serverless applications and job runs.</p>
tags: <p>The tags to add to the resource. A tag is an array of key-value pairs.</p>
Raises:
capo_emr_serverless.errors.internal_server_exception.InternalServerException: <p>Request processing failed because of an error or failure with the service.</p>
capo_emr_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_emr_serverless.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_emr_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_emr_serverless.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_emr_serverless.types.tag_resource_response.TagResourceResponse"
]:
import capo_emr_serverless._operations.aws_toledo_web_service.tag_resource
(
output,
http_response,
) = await capo_emr_serverless._operations.aws_toledo_web_service.tag_resource.async_tag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagResource")
)
input_: capo_emr_serverless.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags": tags,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|