usage_plan_keys
Creates, updates, deletes, gets or lists a usage_plan_keys resource.
Overview
| Name | usage_plan_keys |
| Type | Resource |
| Id | aws.apigateway.usage_plan_keys |
Fields
The following fields are returned by SELECT queries:
- get_usage_plan_key
- get_usage_plan_keys
| Name | Datatype | Description |
|---|---|---|
id | string | The Id of a usage plan key. |
name | string | The name of a usage plan key. |
type_ | string | The type of a usage plan key. Currently, the valid key type is API_KEY. |
value | string | The value of a usage plan key. |
| Name | Datatype | Description |
|---|---|---|
id | string | The Id of a usage plan key. |
name | string | The name of a usage plan key. |
type_ | string | The type of a usage plan key. Currently, the valid key type is API_KEY. |
value | string | The value of a usage plan key. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_usage_plan_key | select | usageplan_id, key_id, region | Gets a usage plan key of a given key identifier. | |
get_usage_plan_keys | select | usageplan_id, region | position, limit, name | Gets all the usage plan keys representing the API keys added to a specified usage plan. |
create_usage_plan_key | insert | usageplan_id, region, keyId, keyType | Creates a usage plan key for adding an existing API key to a usage plan. | |
delete_usage_plan_key | delete | usageplan_id, key_id, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
key_id | string | The Id of the UsagePlanKey resource to be deleted. |
region | string | AWS region (default: us-east-1) |
usageplan_id | string | The Id of the UsagePlan resource representing the usage plan containing the to-be-deleted UsagePlanKey resource representing a plan customer. |
limit | integer | The maximum number of returned results per page. The default value is 25 and the maximum value is 500. |
name | string | A query parameter specifying the name of the to-be-returned usage plan keys. |
position | string | The current pagination position in the paged result set. |
SELECT examples
- get_usage_plan_key
- get_usage_plan_keys
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
;
Gets all the usage plan keys representing the API keys added to a specified usage plan.
SELECT
id,
name,
type_,
value
FROM aws.apigateway.usage_plan_keys
WHERE usageplan_id = '{{ usageplan_id }}' -- required
AND region = '{{ region }}' -- required
AND position = '{{ position }}'
AND limit = '{{ limit }}'
AND name = '{{ name }}'
;
INSERT examples
- create_usage_plan_key
- Manifest
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
;
# Description fields are for documentation purposes
- name: usage_plan_keys
props:
- name: usageplan_id
value: "{{ usageplan_id }}"
description: Required parameter for the usage_plan_keys resource.
- name: region
value: "{{ region }}"
description: Required parameter for the usage_plan_keys resource.
- name: keyId
value: "{{ keyId }}"
- name: keyType
value: "{{ keyType }}"
DELETE examples
- delete_usage_plan_key
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
;