Skip to content

tag_resource

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

This operation tags a resource.

Parameters:

  • resource_arn (__string) –

    An Amazon Resource Name (ARN) that uniquely identifies an AWS resource.

  • tags (MapOf__string) –

    A label that consists of a customer-defined key and an optional value.

Raises:

Source code in docs_src/capo_dataexchange/_services/data_exchange.py
def tag_resource(
    self,
    resource_arn: "capo_dataexchange.types.__string.__string",
    tags: "capo_dataexchange.types.map_of__string.MapOf__string",
    *,
    config_overrides: Optional[DataExchangeClientConfig] = None,
) -> None:
    """<p>This operation tags a resource.</p>

    Args:
        resource_arn: <p>An Amazon Resource Name (ARN) that uniquely identifies an AWS resource.</p>
        tags: <p>A label that consists of a customer-defined key and an optional value.</p>

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

    def _handler(
        req: "OperationRequest[capo_dataexchange.types.tag_resource_request.TagResourceRequest]",
    ) -> OperationResponse[None]:
        import capo_dataexchange._operations.data_exchange.tag_resource

        output, http_response = (
            capo_dataexchange._operations.data_exchange.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_dataexchange.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