Skip to main content

usage_plan_keys

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

Overview

Nameusage_plan_keys
TypeResource
Idaws.apigateway.usage_plan_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe Id of a usage plan key.
namestringThe name of a usage plan key.
type_stringThe type of a usage plan key. Currently, the valid key type is API_KEY.
valuestringThe value of a usage plan key.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_usage_plan_keyselectusageplan_id, key_id, regionGets a usage plan key of a given key identifier.
get_usage_plan_keysselectusageplan_id, regionposition, limit, nameGets all the usage plan keys representing the API keys added to a specified usage plan.
create_usage_plan_keyinsertusageplan_id, region, keyId, keyTypeCreates a usage plan key for adding an existing API key to a usage plan.
delete_usage_plan_keydeleteusageplan_id, key_id, regionDeletes a usage plan key and remove the underlying API key from the associated usage plan.

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
key_idstringThe Id of the UsagePlanKey resource to be deleted.
regionstringAWS region (default: us-east-1)
usageplan_idstringThe Id of the UsagePlan resource representing the usage plan containing the to-be-deleted UsagePlanKey resource representing a plan customer.
limitintegerThe maximum number of returned results per page. The default value is 25 and the maximum value is 500.
namestringA query parameter specifying the name of the to-be-returned usage plan keys.
positionstringThe current pagination position in the paged result set.

SELECT examples

Gets a usage plan key of a given key identifier.

SELECT
id,
name,
type_,
value
FROM aws.apigateway.usage_plan_keys
WHERE usageplan_id = '{{ usageplan_id }}' -- required
AND key_id = '{{ key_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a usage plan key for adding an existing API key to a usage plan.

INSERT INTO aws.apigateway.usage_plan_keys (
keyId,
keyType,
usageplan_id,
region
)
SELECT
'{{ keyId }}' /* required */,
'{{ keyType }}' /* required */,
'{{ usageplan_id }}',
'{{ region }}'
RETURNING
id,
name,
type_,
value
;

DELETE examples

Deletes a usage plan key and remove the underlying API key from the associated usage plan.

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