Skip to content

tag_resource

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

Assigns one or more tags (key-value pairs) to the specified resource.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the resource that you want to tag.

  • tags (TagList) –

    A map of the key-value pairs of the tag or tags to assign to the resource.

Raises:

Source code in docs_src/capo_appfabric/_services/app_fabric.py
def tag_resource(
    self,
    resource_arn: "capo_appfabric.types.arn.Arn",
    tags: "capo_appfabric.types.tag_list.TagList",
    *,
    config_overrides: Optional[AppFabricClientConfig] = None,
) -> "capo_appfabric.types.tag_resource_response.TagResourceResponse":
    """<p>Assigns one or more tags (key-value pairs) to the specified resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to tag.</p>
        tags: <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>

    Raises:
        capo_appfabric.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform this operation.</p>
        capo_appfabric.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure with an internal server.</p>
        capo_appfabric.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_appfabric.errors.throttling_exception.ThrottlingException: <p>The request rate exceeds the limit.</p>
        capo_appfabric.errors.validation_exception.ValidationException: <p>The request has invalid or missing parameters.</p>
        capo_appfabric.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_appfabric._operations.fabric_front_end_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_appfabric.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