Skip to content

tag_resource

tag_resource(
    resource_arn: str,
    tags: Tags,
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
) -> TagResourceResponse

Tags the resource with a tag key and value.

Parameters:

  • resource_arn (str) –

    The Amazon Resource Name (ARN) to use to tag a resource.

  • tags (Tags) –

    A list of tag key value pairs for a specified Amazon Resource Name (ARN).

Raises:

Source code in docs_src/capo_amplifyuibuilder/_services/amplify_ui_builder.py
def tag_resource(
    self,
    resource_arn: str,
    tags: "capo_amplifyuibuilder.types.tags.Tags",
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
) -> "capo_amplifyuibuilder.types.tag_resource_response.TagResourceResponse":
    """<p>Tags the resource with a tag key and value.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) to use to tag a resource.</p>
        tags: <p>A list of tag key value pairs for a specified Amazon Resource Name (ARN).</p>

    Raises:
        capo_amplifyuibuilder.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred. Please retry your request.</p>
        capo_amplifyuibuilder.errors.invalid_parameter_exception.InvalidParameterException: <p>An invalid or out-of-range value was supplied for the input parameter.</p>
        capo_amplifyuibuilder.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist, or access was denied.</p>
        capo_amplifyuibuilder.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_amplifyuibuilder.errors.unauthorized_exception.UnauthorizedException: <p>You don't have permission to perform this operation.</p>
        capo_amplifyuibuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_amplifyuibuilder._operations.amplify_ui_builder.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_amplifyuibuilder.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