Skip to content

tag_resource async

tag_resource(
    resource_arn: __string,
    tags: __mapOf__string,
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
) -> None

The resource to tag. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see Tagging AWS Elemental MediaTailor Resources.

Parameters:

  • resource_arn (__string) –

    The Amazon Resource Name (ARN) associated with the resource.

  • tags (__mapOf__string) –

    The tags to assign to the resource. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see Tagging AWS Elemental MediaTailor Resources.

Raises:

Source code in docs_src/capo_mediatailor/_services/async_media_tailor.py
async def tag_resource(
    self,
    resource_arn: "capo_mediatailor.types.__string.__string",
    tags: "capo_mediatailor.types.__map_of__string.__mapOf__string",
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
) -> None:
    """<p>The resource to tag. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html">Tagging AWS Elemental MediaTailor Resources</a>.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) associated with the resource.</p>
        tags: <p>The tags to assign to the resource. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html">Tagging AWS Elemental MediaTailor Resources</a>.</p>

    Raises:
        capo_mediatailor.errors.bad_request_exception.BadRequestException: <p>A request contains unexpected data.</p>
        capo_mediatailor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediatailor.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_mediatailor._operations.media_tailor.tag_resource

        (
            output,
            http_response,
        ) = await capo_mediatailor._operations.media_tailor.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_mediatailor.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