Skip to content

tag_resource

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

Adds one or more tags to a specified resource.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) for the resource that you want to add tags to.

  • tags (TagMap) –

    The tags that you want to add to the specified resource.

Raises:

Source code in docs_src/capo_route53profiles/_services/route53_profiles.py
def tag_resource(
    self,
    resource_arn: "capo_route53profiles.types.arn.Arn",
    tags: "capo_route53profiles.types.tag_map.TagMap",
    *,
    config_overrides: Optional[Route53ProfilesClientConfig] = None,
) -> "capo_route53profiles.types.tag_resource_response.TagResourceResponse":
    """<p> Adds one or more tags to a specified resource. </p>

    Args:
        resource_arn: <p> The Amazon Resource Name (ARN) for the resource that you want to add tags to. </p>
        tags: <p> The tags that you want to add to the specified resource. </p>

    Raises:
        capo_route53profiles.errors.access_denied_exception.AccessDeniedException: <p> The current account doesn't have the IAM permissions required to perform the specified operation. </p>
        capo_route53profiles.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource you are associating is not found. </p>
        capo_route53profiles.errors.throttling_exception.ThrottlingException: <p> The request was throttled. Try again in a few minutes. </p>
        capo_route53profiles.errors.validation_exception.ValidationException: <p> You have provided an invalid command. </p>
        capo_route53profiles.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_route53profiles._operations.route53_profiles.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_route53profiles.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