Skip to main content

usage_limits

Creates, updates, deletes, gets or lists a usage_limits resource.

Overview

Nameusage_limits
TypeResource
Idaws.redshift_serverless.usage_limits

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
amountinteger (int64)The limit amount. If time-based, this amount is in RPUs consumed per hour. If data-based, this amount is in terabytes (TB). The value must be a positive number.
breach_actionstringThe action that Amazon Redshift Serverless takes when the limit is reached. (log, emit-metric, deactivate)
periodstringThe time period that the amount applies to. A weekly period begins on Sunday. The default is monthly. (daily, weekly, monthly)
resource_arnstringThe Amazon Resource Name (ARN) that identifies the Amazon Redshift Serverless resource.
usage_limit_arnstringThe Amazon Resource Name (ARN) of the resource associated with the usage limit.
usage_limit_idstringThe identifier of the usage limit.
usage_typestringThe Amazon Redshift Serverless feature to limit. (serverless-compute, cross-region-datasharing)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_usage_limitselectregionReturns information about a usage limit.
list_usage_limitsselectregionLists all usage limits within Amazon Redshift Serverless.
create_usage_limitinsertregion, amount, resourceArn, usageTypeCreates a usage limit for a specified Amazon Redshift Serverless usage type. The usage limit is identified by the returned usage limit identifier.
update_usage_limitupdateregion, usageLimitIdUpdate a usage limit in Amazon Redshift Serverless. You can't update the usage type or period of a usage limit.
delete_usage_limitdeleteregionDeletes a usage limit from Amazon Redshift Serverless.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about a usage limit.

SELECT
amount,
breach_action,
period,
resource_arn,
usage_limit_arn,
usage_limit_id,
usage_type
FROM aws.redshift_serverless.usage_limits
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a usage limit for a specified Amazon Redshift Serverless usage type. The usage limit is identified by the returned usage limit identifier.

INSERT INTO aws.redshift_serverless.usage_limits (
amount,
breachAction,
period,
resourceArn,
usageType,
region
)
SELECT
{{ amount }} /* required */,
'{{ breachAction }}',
'{{ period }}',
'{{ resourceArn }}' /* required */,
'{{ usageType }}' /* required */,
'{{ region }}'
RETURNING
usage_limit
;

UPDATE examples

Update a usage limit in Amazon Redshift Serverless. You can't update the usage type or period of a usage limit.

UPDATE aws.redshift_serverless.usage_limits
SET
amount = {{ amount }},
breachAction = '{{ breachAction }}',
usageLimitId = '{{ usageLimitId }}'
WHERE
region = '{{ region }}' --required
AND usageLimitId = '{{ usageLimitId }}' --required
RETURNING
usage_limit;

DELETE examples

Deletes a usage limit from Amazon Redshift Serverless.

DELETE FROM aws.redshift_serverless.usage_limits
WHERE region = '{{ region }}' --required
;