api_keys
Creates, updates, deletes, gets or lists an api_keys resource.
Overview
| Name | api_keys |
| Type | Resource |
| Id | aws.apigateway.api_keys |
Fields
The following fields are returned by SELECT queries:
- get_api_key
- get_api_keys
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the API Key. |
name | string | The name of the API Key. |
created_date | string (date-time) | The timestamp when the API Key was created. |
customer_id | string | An Amazon Web Services Marketplace customer identifier, when integrating with the Amazon Web Services SaaS Marketplace. |
description | string | The description of the API Key. |
enabled | boolean | Specifies whether the API Key can be used by callers. |
last_updated_date | string (date-time) | The timestamp when the API Key was last updated. |
stage_keys | array | A list of Stage resources that are associated with the ApiKey resource. |
tags | object | The collection of tags. Each tag element is associated with a given resource. |
value | string | The value of the API Key. |
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the API Key. |
name | string | The name of the API Key. |
created_date | string (date-time) | The timestamp when the API Key was created. |
customer_id | string | An Amazon Web Services Marketplace customer identifier, when integrating with the Amazon Web Services SaaS Marketplace. |
description | string | The description of the API Key. |
enabled | boolean | Specifies whether the API Key can be used by callers. |
last_updated_date | string (date-time) | The timestamp when the API Key was last updated. |
stage_keys | array | A list of Stage resources that are associated with the ApiKey resource. |
tags | object | The collection of tags. Each tag element is associated with a given resource. |
value | string | The value of the API Key. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_api_key | select | api__key, region | includeValue | Gets information about the current ApiKey resource. |
get_api_keys | select | region | position, limit, name, customerId, includeValues | Gets information about the current ApiKeys resource. |
create_api_key | insert | region | Create an ApiKey resource. | |
update_api_key | update | api__key, region | Changes information about an ApiKey resource. | |
delete_api_key | delete | api__key, region | Deletes the ApiKey resource. | |
import_api_keys | exec | format, region, body | failonwarnings | Import API keys from an external source, such as a CSV-formatted file. |
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 |
|---|---|---|
api__key | string | The identifier of the ApiKey resource to be deleted. |
format | string | A query parameter to specify the input format to imported API keys. Currently, only the csv format is supported. |
region | string | AWS region (default: us-east-1) |
customerId | string | The identifier of a customer in Amazon Web Services Marketplace or an external system, such as a developer portal. |
failonwarnings | boolean | A query parameter to indicate whether to rollback ApiKey importation (true) or not (false) when error is encountered. |
includeValue | boolean | A boolean flag to specify whether (true) or not (false) the result contains the key value. |
includeValues | boolean | A boolean flag to specify whether (true) or not (false) the result contains key values. |
limit | integer | The maximum number of returned results per page. The default value is 25 and the maximum value is 500. |
name | string | The name of queried API keys. |
position | string | The current pagination position in the paged result set. |
SELECT examples
- get_api_key
- get_api_keys
Gets information about the current ApiKey resource.
SELECT
id,
name,
created_date,
customer_id,
description,
enabled,
last_updated_date,
stage_keys,
tags,
value
FROM aws.apigateway.api_keys
WHERE api__key = '{{ api__key }}' -- required
AND region = '{{ region }}' -- required
AND includeValue = '{{ includeValue }}'
;
Gets information about the current ApiKeys resource.
SELECT
id,
name,
created_date,
customer_id,
description,
enabled,
last_updated_date,
stage_keys,
tags,
value
FROM aws.apigateway.api_keys
WHERE region = '{{ region }}' -- required
AND position = '{{ position }}'
AND limit = '{{ limit }}'
AND name = '{{ name }}'
AND customerId = '{{ customerId }}'
AND includeValues = '{{ includeValues }}'
;
INSERT examples
- create_api_key
- Manifest
Create an ApiKey resource.
INSERT INTO aws.apigateway.api_keys (
name,
description,
enabled,
generateDistinctId,
value,
stageKeys,
customerId,
tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
{{ enabled }},
{{ generateDistinctId }},
'{{ value }}',
'{{ stageKeys }}',
'{{ customerId }}',
'{{ tags }}',
'{{ region }}'
RETURNING
id,
name,
created_date,
customer_id,
description,
enabled,
last_updated_date,
stage_keys,
tags,
value
;
# Description fields are for documentation purposes
- name: api_keys
props:
- name: region
value: "{{ region }}"
description: Required parameter for the api_keys resource.
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: enabled
value: {{ enabled }}
- name: generateDistinctId
value: {{ generateDistinctId }}
- name: value
value: "{{ value }}"
- name: stageKeys
value:
- restApiId: "{{ restApiId }}"
stageName: "{{ stageName }}"
- name: customerId
value: "{{ customerId }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_api_key
Changes information about an ApiKey resource.
UPDATE aws.apigateway.api_keys
SET
patchOperations = '{{ patchOperations }}'
WHERE
api__key = '{{ api__key }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
name,
created_date,
customer_id,
description,
enabled,
last_updated_date,
stage_keys,
tags,
value;
DELETE examples
- delete_api_key
Deletes the ApiKey resource.
DELETE FROM aws.apigateway.api_keys
WHERE api__key = '{{ api__key }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- import_api_keys
Import API keys from an external source, such as a CSV-formatted file.
EXEC aws.apigateway.api_keys.import_api_keys
@format='{{ format }}' --required,
@region='{{ region }}' --required,
@failonwarnings={{ failonwarnings }}
@@json=
'{
"body": "{{ body }}"
}'
;