Skip to content

tag_resource async

tag_resource(
    resource_arn: RsiArn,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncEMRcontainersClientConfig] = None,
) -> TagResourceResponse

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. For example, you can define a set of tags for your Amazon EMR on EKS clusters to help you track each cluster's owner and stack level. We recommend that you devise a consistent set of tag keys for each resource type. You can then search and filter the resources based on the tags that you add.

Parameters:

  • resource_arn (RsiArn) –

    The ARN of resources.

  • tags (TagMap) –

    The tags assigned to resources.

Raises:

Source code in docs_src/capo_emr_containers/_services/async_em_rcontainers.py
async def tag_resource(
    self,
    resource_arn: "capo_emr_containers.types.rsi_arn.RsiArn",
    tags: "capo_emr_containers.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncEMRcontainersClientConfig] = None,
) -> "capo_emr_containers.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. For example, you can define a set of tags for your Amazon EMR on EKS clusters to help you track each cluster's owner and stack level. We recommend that you devise a consistent set of tag keys for each resource type. You can then search and filter the resources based on the tags that you add.</p>

    Args:
        resource_arn: <p>The ARN of resources.</p>
        tags: <p>The tags assigned to resources.</p>

    Raises:
        capo_emr_containers.errors.internal_server_exception.InternalServerException: <p>This is an internal server exception.</p>
        capo_emr_containers.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_emr_containers.errors.validation_exception.ValidationException: <p>There are invalid parameters in the client request.</p>
        capo_emr_containers.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_emr_containers.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_emr_containers.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_emr_containers._operations.aws_chicago_web_service.tag_resource

        (
            output,
            http_response,
        ) = await capo_emr_containers._operations.aws_chicago_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_containers.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