Skip to content

tag_resource

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

Associate a set of tags with a Timestream resource. You can then activate these user-defined tags so that they appear on the Billing and Cost Management console for cost allocation tracking.

Parameters:

  • resource_arn (AmazonResourceName) –

    Identifies the Timestream resource to which tags should be added. This value is an Amazon Resource Name (ARN).

  • tags (TagList) –

    The tags to be assigned to the Timestream resource.

Raises:

Source code in docs_src/capo_timestream_query/_services/timestream_query.py
def tag_resource(
    self,
    resource_arn: "capo_timestream_query.types.amazon_resource_name.AmazonResourceName",
    tags: "capo_timestream_query.types.tag_list.TagList",
    *,
    config_overrides: Optional[TimestreamQueryClientConfig] = None,
) -> "capo_timestream_query.types.tag_resource_response.TagResourceResponse":
    """<p>Associate a set of tags with a Timestream resource. You can then activate these user-defined tags so that they appear on the Billing and Cost Management console for cost allocation tracking. </p>

    Args:
        resource_arn: <p>Identifies the Timestream resource to which tags should be added. This value is an Amazon Resource Name (ARN).</p>
        tags: <p>The tags to be assigned to the Timestream resource.</p>

    Raises:
        capo_timestream_query.errors.invalid_endpoint_exception.InvalidEndpointException: <p>The requested endpoint is invalid.</p>
        capo_timestream_query.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_timestream_query.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded the service quota.</p>
        capo_timestream_query.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to excessive requests.</p>
        capo_timestream_query.errors.validation_exception.ValidationException: <p> Invalid or malformed request. </p>
        capo_timestream_query.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_timestream_query._operations.timestream_20181101.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_timestream_query.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