Skip to main content

keys

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

Overview

Namekeys
TypeResource
Idaws.location.keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
create_timestring (date-time)The timestamp for when the API key resource was created in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
descriptionstringThe optional description for the API key resource.
expire_timestring (date-time)The timestamp for when the API key resource will expire in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
keystringThe key value/string of an API key.
key_arnstringThe 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_namestringThe name of the API key resource. (pattern: <code>[-._\w]+</code>)
restrictionsobjectAPI Restrictions on the allowed actions, resources, and referers for an API key resource.
tagsobjectTags associated with the API key resource.
update_timestring (date-time)The timestamp for when the API key resource was last updated in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_keyselectkey_name, regionRetrieves the API key resource details. For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide.
list_keysselectregionLists 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_keyinsertregion, KeyNameCreates 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_keyupdatekey_name, regionUpdates the specified properties of a given API key resource.
delete_keydeletekey_name, regionforceDeleteDeletes 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.

NameDatatypeDescription
key_namestringThe name of the API key to delete.
regionstringAWS region (default: us-east-1)
forceDeletebooleanForceDelete 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

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
;

INSERT examples

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
;

UPDATE examples

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

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 }}'
;