Skip to content

tag_resource

tag_resource(
    resource_arn: CleanroomsArn,
    tags: TagMap,
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
) -> TagResourceOutput

Tags a resource.

Parameters:

  • resource_arn (CleanroomsArn) –

    The Amazon Resource Name (ARN) associated with the resource you want to tag.

  • tags (TagMap) –

    A map of objects specifying each key name and value.

Raises:

Source code in docs_src/capo_cleanrooms/_services/clean_rooms.py
def tag_resource(
    self,
    resource_arn: "capo_cleanrooms.types.cleanrooms_arn.CleanroomsArn",
    tags: "capo_cleanrooms.types.tag_map.TagMap",
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
) -> "capo_cleanrooms.types.tag_resource_output.TagResourceOutput":
    """<p>Tags a resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) associated with the resource you want to tag.</p>
        tags: <p>A map of objects specifying each key name and value.</p>

    Raises:
        capo_cleanrooms.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_cleanrooms.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_cleanrooms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cleanrooms.types.tag_resource_input.TagResourceInput]",
    ) -> OperationResponse[
        "capo_cleanrooms.types.tag_resource_output.TagResourceOutput"
    ]:
        import capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.tag_resource

        output, http_response = (
            capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.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_cleanrooms.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