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 = 'us-east-1' AND
Identifier = '{{ key_name }}';
Lists all api_keys in a region.
SELECT
region,
key_name
FROM awscc.location.api_keys_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ 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 }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.location.api_keys
WHERE
Identifier = '{{ key_name }}' AND
region = 'us-east-1';
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