usage_limits
Creates, updates, deletes, gets or lists a usage_limits resource.
Overview
| Name | usage_limits |
| Type | Resource |
| Id | aws.redshift.usage_limits |
Fields
The following fields are returned by SELECT queries:
- describe_usage_limits
| Name | Datatype | Description |
|---|---|---|
amount | integer | The limit amount. If time-based, this amount is in minutes. If data-based, this amount is in terabytes (TB). |
breach_action | string | The action that Amazon Redshift takes when the limit is reached. Possible values are: log - To log an event in a system table. The default is log. emit-metric - To emit CloudWatch metrics. disable - To disable the feature until the next usage period begins. |
cluster_identifier | string | The identifier of the cluster with a usage limit. |
feature_type | string | The Amazon Redshift feature to which the limit applies. |
limit_type | string | The type of limit. Depending on the feature type, this can be based on a time duration or data size. |
period | string | The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly. |
tags | string | A list of tag instances. |
usage_limit_id | string | The identifier of the usage limit. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_usage_limits | select | region | UsageLimitId, ClusterIdentifier, FeatureType, MaxRecords, Marker, TagKeys, TagValues | Shows usage limits on a cluster. Results are filtered based on the combination of input usage limit identifier, cluster identifier, and feature type parameters: If usage limit identifier, cluster identifier, and feature type are not provided, then all usage limit objects for the current account in the current region are returned. If usage limit identifier is provided, then the corresponding usage limit object is returned. If cluster identifier is provided, then all usage limit objects for the specified cluster are returned. If cluster identifier and feature type are provided, then all usage limit objects for the combination of cluster and feature are returned. |
create_usage_limit | insert | ClusterIdentifier, FeatureType, LimitType, region | Amount, Period, BreachAction, Tags | Creates a usage limit for a specified Amazon Redshift feature on a cluster. The usage limit is identified by the returned usage limit identifier. |
modify_usage_limit | update | UsageLimitId, region | Amount, BreachAction | Modifies a usage limit in a cluster. You can't modify the feature type or period of a usage limit. |
delete_usage_limit | delete | UsageLimitId, region | Deletes a usage limit from a cluster. |
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.
| Name | Datatype | Description |
|---|---|---|
ClusterIdentifier | string | The identifier of the cluster that you want to limit usage. |
FeatureType | string | The Amazon Redshift feature that you want to limit. |
LimitType | string | The type of limit. Depending on the feature type, this can be based on a time duration or data size. If FeatureType is spectrum, then LimitType must be data-scanned. If FeatureType is concurrency-scaling, then LimitType must be time. If FeatureType is cross-region-datasharing, then LimitType must be data-scanned. If FeatureType is extra-compute-for-automatic-optimization, then LimitType must be time. |
UsageLimitId | string | The identifier of the usage limit to delete. |
region | string | AWS region (default: us-east-1) |
Amount | integer (int64) | The new limit amount. For more information about this parameter, see UsageLimit. |
BreachAction | string | The new action that Amazon Redshift takes when the limit is reached. For more information about this parameter, see UsageLimit. |
ClusterIdentifier | string | The identifier of the cluster for which you want to describe usage limits. |
FeatureType | string | The feature type for which you want to describe usage limits. |
Marker | string | An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeUsageLimits request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request. |
MaxRecords | integer | The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. Default: 100 Constraints: minimum 20, maximum 100. |
Period | string | The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly. |
TagKeys | array | A tag key or keys for which you want to return all matching usage limit objects that are associated with the specified key or keys. For example, suppose that you have parameter groups that are tagged with keys called owner and environment. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the usage limit objects have either or both of these tag keys associated with them. |
TagValues | array | A tag value or values for which you want to return all matching usage limit objects that are associated with the specified tag value or values. For example, suppose that you have parameter groups that are tagged with values called admin and test. If you specify both of these tag values in the request, Amazon Redshift returns a response with the usage limit objects that have either or both of these tag values associated with them. |
Tags | array | A list of tag instances. |
UsageLimitId | string | The identifier of the usage limit to describe. |
SELECT examples
- describe_usage_limits
Shows usage limits on a cluster. Results are filtered based on the combination of input usage limit identifier, cluster identifier, and feature type parameters: If usage limit identifier, cluster identifier, and feature type are not provided, then all usage limit objects for the current account in the current region are returned. If usage limit identifier is provided, then the corresponding usage limit object is returned. If cluster identifier is provided, then all usage limit objects for the specified cluster are returned. If cluster identifier and feature type are provided, then all usage limit objects for the combination of cluster and feature are returned.
SELECT
amount,
breach_action,
cluster_identifier,
feature_type,
limit_type,
period,
tags,
usage_limit_id
FROM aws.redshift.usage_limits
WHERE region = '{{ region }}' -- required
AND UsageLimitId = '{{ UsageLimitId }}'
AND ClusterIdentifier = '{{ ClusterIdentifier }}'
AND FeatureType = '{{ FeatureType }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
AND TagKeys = '{{ TagKeys }}'
AND TagValues = '{{ TagValues }}'
;
INSERT examples
- create_usage_limit
- Manifest
Creates a usage limit for a specified Amazon Redshift feature on a cluster. The usage limit is identified by the returned usage limit identifier.
INSERT INTO aws.redshift.usage_limits (
ClusterIdentifier,
FeatureType,
LimitType,
region,
Amount,
Period,
BreachAction,
Tags
)
SELECT
'{{ ClusterIdentifier }}',
'{{ FeatureType }}',
'{{ LimitType }}',
'{{ region }}',
'{{ Amount }}',
'{{ Period }}',
'{{ BreachAction }}',
'{{ Tags }}'
RETURNING
amount,
breach_action,
cluster_identifier,
feature_type,
limit_type,
period,
tags,
usage_limit_id
;
# Description fields are for documentation purposes
- name: usage_limits
props:
- name: ClusterIdentifier
value: "{{ ClusterIdentifier }}"
description: Required parameter for the usage_limits resource.
- name: FeatureType
value: "{{ FeatureType }}"
description: Required parameter for the usage_limits resource.
- name: LimitType
value: "{{ LimitType }}"
description: Required parameter for the usage_limits resource.
- name: region
value: "{{ region }}"
description: Required parameter for the usage_limits resource.
- name: Amount
value: "{{ Amount }}"
description: The limit amount. If time-based, this amount is in minutes. If data-based, this amount is in terabytes (TB). The value must be a positive number.
description: The limit amount. If time-based, this amount is in minutes. If data-based, this amount is in terabytes (TB). The value must be a positive number.
- name: Period
value: "{{ Period }}"
description: The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.
description: The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.
- name: BreachAction
value: "{{ BreachAction }}"
description: The action that Amazon Redshift takes when the limit is reached. The default is log. For more information about this parameter, see UsageLimit.
description: The action that Amazon Redshift takes when the limit is reached. The default is log. For more information about this parameter, see UsageLimit.
- name: Tags
value: "{{ Tags }}"
description: A list of tag instances.
description: A list of tag instances.
UPDATE examples
- modify_usage_limit
Modifies a usage limit in a cluster. You can't modify the feature type or period of a usage limit.
UPDATE aws.redshift.usage_limits
SET
-- No updatable properties
WHERE
UsageLimitId = '{{ UsageLimitId }}' --required
AND region = '{{ region }}' --required
AND Amount = '{{ Amount}}'
AND BreachAction = '{{ BreachAction}}'
RETURNING
amount,
breach_action,
cluster_identifier,
feature_type,
limit_type,
period,
tags,
usage_limit_id;
DELETE examples
- delete_usage_limit
Deletes a usage limit from a cluster.
DELETE FROM aws.redshift.usage_limits
WHERE UsageLimitId = '{{ UsageLimitId }}' --required
AND region = '{{ region }}' --required
;