Skip to content

tag_resource

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

Adds tags to the specified resource.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the resource.

  • tags (TagMap) –

    The tags to add to the resource.

Raises:

Source code in docs_src/capo_outposts/_services/outposts.py
def tag_resource(
    self,
    resource_arn: "capo_outposts.types.arn.Arn",
    tags: "capo_outposts.types.tag_map.TagMap",
    *,
    config_overrides: Optional[OutpostsClientConfig] = None,
) -> "capo_outposts.types.tag_resource_response.TagResourceResponse":
    """<p>Adds tags to the specified resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource.</p>
        tags: <p>The tags to add to the resource.</p>

    Raises:
        capo_outposts.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred.</p>
        capo_outposts.errors.not_found_exception.NotFoundException: <p>The specified request is not valid.</p>
        capo_outposts.errors.validation_exception.ValidationException: <p>A parameter is not valid.</p>
        capo_outposts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_outposts.types.tag_resource_request.TagResourceRequest]",
    ) -> OperationResponse[
        "capo_outposts.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_outposts._operations.outposts_olaf_service.tag_resource

        output, http_response = (
            capo_outposts._operations.outposts_olaf_service.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_outposts.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