api_keys
Creates, updates, deletes or gets an api_key resource or lists api_keys in a region
Overview
| Name | api_keys |
| Type | Resource |
| Description | Definition of AWS::Location::APIKey Resource Type |
| Id | awscc.location.api_keys |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
create_time | string | The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ) |
description | string | |
force_update | boolean | |
key_arn | string | |
key_name | string | |
no_expiry | boolean | |
restrictions | object | |
tags | array | An array of key-value pairs to apply to this resource. |
force_delete | boolean | |
arn | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
key_name | string | |
region | string | AWS region. |
For more information, see AWS::Location::APIKey.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | api_keys | INSERT | KeyName, Restrictions, region |
delete_resource | api_keys | DELETE | Identifier, region |
update_resource | api_keys | UPDATE | Identifier, PatchDocument, region |
list_resources | api_keys_list_only | SELECT | region |
get_resource | api_keys | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all api_keys in a region.
SELECT
region,
key_name
FROM awscc.location.api_keys_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new api_key resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.location.api_keys (
Description,
ExpireTime,
ForceUpdate,
KeyName,
NoExpiry,
Restrictions,
Tags,
ForceDelete,
region
)
SELECT
'{{ description }}',
'{{ expire_time }}',
'{{ force_update }}',
'{{ key_name }}',
'{{ no_expiry }}',
'{{ restrictions }}',
'{{ tags }}',
'{{ force_delete }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: api_key
props:
- name: description
value: '{{ description }}'
- name: expire_time
value: '{{ expire_time }}'
- name: force_update
value: '{{ force_update }}'
- name: key_name
value: '{{ key_name }}'
- name: no_expiry
value: '{{ no_expiry }}'
- name: restrictions
value:
allow_actions:
- '{{ allow_actions[0] }}'
allow_resources:
- '{{ allow_resources[0] }}'
allow_referers:
- '{{ allow_referers[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: force_delete
value: '{{ force_delete }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Read
- Update
- Delete
- List
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
geo:DescribeKey
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,
geo:UpdateKey
geo:DeleteKey,
geo:DescribeKey
geo:ListKeys