keys
Creates, updates, deletes, gets or lists a keys resource.
Overview
| Name | keys |
| Type | Resource |
| Id | aws.location.keys |
Fields
The following fields are returned by SELECT queries:
- describe_key
- list_keys
| Name | Datatype | Description |
|---|---|---|
create_time | string (date-time) | The timestamp for when the API key resource was created in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
description | string | The optional description for the API key resource. |
expire_time | string (date-time) | The timestamp for when the API key resource will expire in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
key | string | The key value/string of an API key. |
key_arn | string | The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services. Format example: arn:aws:geo:region:account-id:key/ExampleKey (pattern: <code>arn(:[a-z0-9]+([.-][a-z0-9]+)){2}(:([a-z0-9]+([.-][a-z0-9]+))?){2}:([^/].*)?</code>) |
key_name | string | The name of the API key resource. (pattern: <code>[-._\w]+</code>) |
restrictions | object | API Restrictions on the allowed actions, resources, and referers for an API key resource. |
tags | object | Tags associated with the API key resource. |
update_time | string (date-time) | The timestamp for when the API key resource was last updated in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
| Name | Datatype | Description |
|---|---|---|
create_time | string (date-time) | The timestamp of when the API key was created, in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
description | string | The optional description for the API key resource. |
expire_time | string (date-time) | The timestamp for when the API key resource will expire, in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
key_name | string | The name of the API key resource. (pattern: <code>[-._\w]+</code>) |
restrictions | object | API Restrictions on the allowed actions, resources, and referers for an API key resource. |
update_time | string (date-time) | The timestamp of when the API key was last updated, in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_key | select | key_name, region | Retrieves the API key resource details. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide. | |
list_keys | select | region | Lists API key resources in your Amazon Web Services account. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide. | |
create_key | insert | region, KeyName | Creates an API key resource in your Amazon Web Services account, which lets you grant actions for Amazon Location resources to the API key bearer. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide. | |
update_key | update | key_name, region | Updates the specified properties of a given API key resource. | |
delete_key | delete | key_name, region | forceDelete | Deletes the specified API key. The API key must have been deactivated more than 90 days previously. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide. |
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_name | string | The name of the API key to delete. |
region | string | AWS region (default: us-east-1) |
forceDelete | boolean | ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter true to delete the key or to false to not preemptively delete the API key. Valid values: true, or false. Required: No This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use. |
SELECT examples
- describe_key
- list_keys
Retrieves the API key resource details. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide.
SELECT
create_time,
description,
expire_time,
key,
key_arn,
key_name,
restrictions,
tags,
update_time
FROM aws.location.keys
WHERE key_name = '{{ key_name }}' -- required
AND region = '{{ region }}' -- required
;
Lists API key resources in your Amazon Web Services account. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide.
SELECT
create_time,
description,
expire_time,
key_name,
restrictions,
update_time
FROM aws.location.keys
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_key
- Manifest
Creates an API key resource in your Amazon Web Services account, which lets you grant actions for Amazon Location resources to the API key bearer. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide.
INSERT INTO aws.location.keys (
KeyName,
Restrictions,
Description,
ExpireTime,
NoExpiry,
Tags,
region
)
SELECT
'{{ KeyName }}' /* required */,
'{{ Restrictions }}',
'{{ Description }}',
'{{ ExpireTime }}',
{{ NoExpiry }},
'{{ Tags }}',
'{{ region }}'
RETURNING
create_time,
key,
key_arn,
key_name
;
# Description fields are for documentation purposes
- name: keys
props:
- name: region
value: "{{ region }}"
description: Required parameter for the keys resource.
- name: KeyName
value: "{{ KeyName }}"
- name: Restrictions
description: |
API Restrictions on the allowed actions, resources, and referers for an API key resource.
value:
AllowActions:
- "{{ AllowActions }}"
AllowResources:
- "{{ AllowResources }}"
AllowReferers:
- "{{ AllowReferers }}"
AllowAndroidApps:
- Package: "{{ Package }}"
CertificateFingerprint: "{{ CertificateFingerprint }}"
AllowAppleApps:
- BundleId: "{{ BundleId }}"
- name: Description
value: "{{ Description }}"
- name: ExpireTime
value: "{{ ExpireTime }}"
- name: NoExpiry
value: {{ NoExpiry }}
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- update_key
Updates the specified properties of a given API key resource.
UPDATE aws.location.keys
SET
Description = '{{ Description }}',
ExpireTime = '{{ ExpireTime }}',
NoExpiry = {{ NoExpiry }},
ForceUpdate = {{ ForceUpdate }},
Restrictions = '{{ Restrictions }}'
WHERE
key_name = '{{ key_name }}' --required
AND region = '{{ region }}' --required
RETURNING
key_arn,
key_name,
update_time;
DELETE examples
- delete_key
Deletes the specified API key. The API key must have been deactivated more than 90 days previously. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide.
DELETE FROM aws.location.keys
WHERE key_name = '{{ key_name }}' --required
AND region = '{{ region }}' --required
AND forceDelete = '{{ forceDelete }}'
;