api_keys
Creates, updates, deletes, gets or lists an api_keys resource.
Overview
| Name | api_keys |
| Type | Resource |
| Id | aws.wafv2.api_keys |
Fields
The following fields are returned by SELECT queries:
- list_api_keys
| Name | Datatype | Description |
|---|---|---|
api_key_summaries | array | The array of key summaries. If you specified a Limit in your request, this might not be the full list. |
application_integration_url | string | The CAPTCHA application integration URL, for use in your JavaScript implementation. |
next_marker | string | When you request a list of objects with a Limit setting, if the number of objects that are still available for retrieval exceeds the limit, WAF returns a NextMarker value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. (pattern: <code>.\S.</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_api_keys | select | region | Retrieves a list of the API keys that you've defined for the specified scope. API keys are required for the integration of the CAPTCHA API in your JavaScript client applications. The API lets you customize the placement and characteristics of the CAPTCHA puzzle for your end users. For more information about the CAPTCHA JavaScript integration, see WAF client application integration in the WAF Developer Guide. | |
create_api_key | insert | region, Scope, TokenDomains | Creates an API key that contains a set of token domains. API keys are required for the integration of the CAPTCHA API in your JavaScript client applications. The API lets you customize the placement and characteristics of the CAPTCHA puzzle for your end users. For more information about the CAPTCHA JavaScript integration, see WAF client application integration in the WAF Developer Guide. You can use a single key for up to 5 domains. After you generate a key, you can copy it for use in your JavaScript integration. | |
delete_api_key | delete | region | Deletes the specified API key. After you delete a key, it can take up to 24 hours for WAF to disallow use of the key in all regions. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_api_keys
Retrieves a list of the API keys that you've defined for the specified scope. API keys are required for the integration of the CAPTCHA API in your JavaScript client applications. The API lets you customize the placement and characteristics of the CAPTCHA puzzle for your end users. For more information about the CAPTCHA JavaScript integration, see WAF client application integration in the WAF Developer Guide.
SELECT
api_key_summaries,
application_integration_url,
next_marker
FROM aws.wafv2.api_keys
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_api_key
- Manifest
Creates an API key that contains a set of token domains. API keys are required for the integration of the CAPTCHA API in your JavaScript client applications. The API lets you customize the placement and characteristics of the CAPTCHA puzzle for your end users. For more information about the CAPTCHA JavaScript integration, see WAF client application integration in the WAF Developer Guide. You can use a single key for up to 5 domains. After you generate a key, you can copy it for use in your JavaScript integration.
INSERT INTO aws.wafv2.api_keys (
Scope,
TokenDomains,
region
)
SELECT
'{{ Scope }}' /* required */,
'{{ TokenDomains }}' /* required */,
'{{ region }}'
RETURNING
api_key
;
# Description fields are for documentation purposes
- name: api_keys
props:
- name: region
value: "{{ region }}"
description: Required parameter for the api_keys resource.
- name: Scope
value: "{{ Scope }}"
description: |
Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use CLOUDFRONT. To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows: CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT --region=us-east-1. API and SDKs - For all calls, use the Region endpoint us-east-1.
valid_values: ['CLOUDFRONT', 'REGIONAL']
- name: TokenDomains
value:
- "{{ TokenDomains }}"
description: |
The client application domains that you want to use this API key for. Example JSON: "TokenDomains": ["abc.com", "store.abc.com"] Public suffixes aren't allowed. For example, you can't use gov.au or co.uk as token domains.
DELETE examples
- delete_api_key
Deletes the specified API key. After you delete a key, it can take up to 24 hours for WAF to disallow use of the key in all regions.
DELETE FROM aws.wafv2.api_keys
WHERE region = '{{ region }}' --required
;