Skip to main content

api_keys

Creates, updates, deletes or gets an api_key resource or lists api_keys in a region

Overview

Nameapi_keys
TypeResource
DescriptionDefinition of AWS::Location::APIKey Resource Type
Idawscc.location.api_keys

Fields

NameDatatypeDescription
create_timestringThe datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)
descriptionstring
force_updateboolean
key_arnstring
key_namestring
no_expiryboolean
restrictionsobject
tagsarrayAn array of key-value pairs to apply to this resource.
force_deleteboolean
arnstring
regionstringAWS region.

For more information, see AWS::Location::APIKey.

Methods

NameResourceAccessible byRequired Params
create_resourceapi_keysINSERTKeyName, Restrictions, region
delete_resourceapi_keysDELETEIdentifier, region
update_resourceapi_keysUPDATEIdentifier, PatchDocument, region
list_resourcesapi_keys_list_onlySELECTregion
get_resourceapi_keysSELECTIdentifier, region

SELECT examples

Gets all properties from an individual api_key.

SELECT
region,
create_time,
description,
expire_time,
force_update,
key_arn,
key_name,
no_expiry,
restrictions,
tags,
update_time,
force_delete,
arn
FROM awscc.location.api_keys
WHERE
region = '{{ region }}' AND
Identifier = '{{ key_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new api_key resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.location.api_keys (
KeyName,
Restrictions,
region
)
SELECT
'{{ key_name }}',
'{{ restrictions }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a api_key resource, using stack-deploy.

/*+ update */
UPDATE awscc.location.api_keys
SET PatchDocument = string('{{ {
"Description": description,
"ExpireTime": expire_time,
"ForceUpdate": force_update,
"NoExpiry": no_expiry,
"Restrictions": restrictions,
"Tags": tags,
"ForceDelete": force_delete
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ key_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.location.api_keys
WHERE
Identifier = '{{ key_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the api_keys resource, the following permissions are required:

geo:CreateKey,
geo:DescribeKey,
geo:TagResource,
geo:UntagResource,
geo:GetMapTile,
geo:GetMapStyleDescriptor,
geo:GetMapSprites,
geo:GetMapGlyphs,
geo:SearchPlaceIndexForText,
geo:SearchPlaceIndexForPosition,
geo:SearchPlaceIndexForSuggestions,
geo:GetPlace,
geo:CalculateRoute,
geo:CalculateRouteMatrix,
geo-maps:GetTile,
geo-maps:GetStaticMap,
geo-places:Autocomplete,
geo-places:Geocode,
geo-places:GetPlace,
geo-places:ReverseGeocode,
geo-places:SearchNearby,
geo-places:SearchText,
geo-places:Suggest,
geo-routes:CalculateIsolines,
geo-routes:CalculateRouteMatrix,
geo-routes:CalculateRoutes,
geo-routes:OptimizeWaypoints,
geo-routes:SnapToRoads