Skip to content

tag_resource async

tag_resource(
    resource_arn: str,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncConnectHealthClientConfig] = None,
) -> None

Associates the specified tags with the specified resource

Parameters:

  • resource_arn (str) –

    The ARN of the resource to tag

  • tags (TagMap) –

    The tags to add to the resource

Raises:

Source code in docs_src/capo_connecthealth/_services/async_connect_health.py
async def tag_resource(
    self,
    resource_arn: str,
    tags: "capo_connecthealth.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncConnectHealthClientConfig] = None,
) -> None:
    """<p>Associates the specified tags with the specified resource</p>

    Args:
        resource_arn: <p>The ARN of the resource to tag</p>
        tags: <p>The tags to add to the resource</p>

    Raises:
        capo_connecthealth.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connecthealth.types.tag_resource_input.TagResourceInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_connecthealth._operations.connect_health.tag_resource

        (
            output,
            http_response,
        ) = await capo_connecthealth._operations.connect_health.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_connecthealth.types.tag_resource_input.TagResourceInput = {
        "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