Skip to content

tag_resource

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

Tags a resource with a map of key and value pairs.

Parameters:

  • resource_arn (Arn) –

    The ARN of the resource that you want to tag.

  • tags (TagMap) –

    A map of key and value pairs to use to tag your resource.

Raises:

Examples:

Tag Resource

>>> client.tag_resource(resource_arn='arn:aws:dsql:us-east-1:111111222222:cluster/kiqenqglxyl2snyvkvnj2c3s2e', tags={'MyKey': 'MyValue'})
Source code in docs_src/capo_dsql/_services/dsql.py
def tag_resource(
    self,
    resource_arn: "capo_dsql.types.arn.Arn",
    tags: "capo_dsql.types.tag_map.TagMap",
    *,
    config_overrides: Optional[DSQLClientConfig] = None,
) -> None:
    """<p>Tags a resource with a map of key and value pairs.</p>

    Args:
        resource_arn: <p>The ARN of the resource that you want to tag.</p>
        tags: <p>A map of key and value pairs to use to tag your resource.</p>

    Raises:
        capo_dsql.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_dsql.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_dsql.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_dsql.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_dsql.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_dsql.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service limit was exceeded.</p>
        capo_dsql.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Tag Resource

        >>> client.tag_resource(resource_arn='arn:aws:dsql:us-east-1:111111222222:cluster/kiqenqglxyl2snyvkvnj2c3s2e', tags={'MyKey': 'MyValue'})
    """

    def _handler(
        req: "OperationRequest[capo_dsql.types.tag_resource_input.TagResourceInput]",
    ) -> OperationResponse[None]:
        import capo_dsql._operations.dsql.tag_resource

        output, http_response = (
            capo_dsql._operations.dsql.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_dsql.types.tag_resource_input.TagResourceInput = {
        "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