Skip to main content

usage_plans

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

Overview

Nameusage_plans
TypeResource
Idaws.apigateway.usage_plans

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier of a UsagePlan resource.
namestringThe name of a usage plan.
api_stagesarrayThe associated API stages of a usage plan.
descriptionstringThe description of a usage plan.
product_codestringThe Amazon Web Services Marketplace product identifier to associate with the usage plan as a SaaS product on the Amazon Web Services Marketplace.
quotaobjectQuotas configured for a usage plan.
tagsobjectThe collection of tags. Each tag element is associated with a given resource.
throttleobjectThe API request rate limits.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_usage_planselectusageplan_id, regionGets a usage plan of a given plan identifier.
get_usage_plansselectregionposition, keyId, limitGets all the usage plans of the caller's account.
create_usage_planinsertregion, nameCreates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.
update_usage_planupdateusageplan_id, regionUpdates a usage plan of a given plan Id.
delete_usage_plandeleteusageplan_id, regionDeletes a usage plan of a given plan Id.

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)
usageplan_idstringThe Id of the to-be-deleted usage plan.
keyIdstringThe identifier of the API key associated with the usage plans.
limitintegerThe maximum number of returned results per page. The default value is 25 and the maximum value is 500.
positionstringThe current pagination position in the paged result set.

SELECT examples

Gets a usage plan of a given plan identifier.

SELECT
id,
name,
api_stages,
description,
product_code,
quota,
tags,
throttle
FROM aws.apigateway.usage_plans
WHERE usageplan_id = '{{ usageplan_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.

INSERT INTO aws.apigateway.usage_plans (
name,
description,
apiStages,
throttle,
quota,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ apiStages }}',
'{{ throttle }}',
'{{ quota }}',
'{{ tags }}',
'{{ region }}'
RETURNING
id,
name,
api_stages,
description,
product_code,
quota,
tags,
throttle
;

UPDATE examples

Updates a usage plan of a given plan Id.

UPDATE aws.apigateway.usage_plans
SET
patchOperations = '{{ patchOperations }}'
WHERE
usageplan_id = '{{ usageplan_id }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
name,
api_stages,
description,
product_code,
quota,
tags,
throttle;

DELETE examples

Deletes a usage plan of a given plan Id.

DELETE FROM aws.apigateway.usage_plans
WHERE usageplan_id = '{{ usageplan_id }}' --required
AND region = '{{ region }}' --required
;