api_mappings
Creates, updates, deletes, gets or lists an api_mappings resource.
Overview
| Name | api_mappings |
| Type | Resource |
| Id | aws.apigatewayv2.api_mappings |
Fields
The following fields are returned by SELECT queries:
- get_api_mapping
- get_api_mappings
| Name | Datatype | Description |
|---|---|---|
api_id | string | The identifier. |
api_mapping_id | string | The identifier. |
api_mapping_key | string | After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression's associated selection key type. |
stage | string | A string with a length between [1-128]. |
| Name | Datatype | Description |
|---|---|---|
items | array | The elements from this collection. |
next_token | string | The next page of elements from this collection. Not valid for the last element of the collection. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_api_mapping | select | api_mapping_id, domain_name, region | Gets an API mapping. | |
get_api_mappings | select | domain_name, region | maxResults, nextToken | Gets API mappings. |
create_api_mapping | insert | domain_name, region, ApiId | Creates an API mapping. | |
update_api_mapping | update | api_mapping_id, domain_name, region, ApiId | The API mapping. | |
delete_api_mapping | delete | api_mapping_id, domain_name, region | Deletes an API mapping. |
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 |
|---|---|---|
api_mapping_id | string | The API mapping identifier. |
domain_name | string | The domain name. |
region | string | AWS region (default: us-east-1) |
maxResults | string | The maximum number of elements to be returned for this resource. |
nextToken | string | The next page of elements from this collection. Not valid for the last element of the collection. |
SELECT examples
- get_api_mapping
- get_api_mappings
Gets an API mapping.
SELECT
api_id,
api_mapping_id,
api_mapping_key,
stage
FROM aws.apigatewayv2.api_mappings
WHERE api_mapping_id = '{{ api_mapping_id }}' -- required
AND domain_name = '{{ domain_name }}' -- required
AND region = '{{ region }}' -- required
;
Gets API mappings.
SELECT
items,
next_token
FROM aws.apigatewayv2.api_mappings
WHERE domain_name = '{{ domain_name }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_api_mapping
- Manifest
Creates an API mapping.
INSERT INTO aws.apigatewayv2.api_mappings (
ApiId,
ApiMappingKey,
Stage,
domain_name,
region
)
SELECT
'{{ ApiId }}' /* required */,
'{{ ApiMappingKey }}',
'{{ Stage }}',
'{{ domain_name }}',
'{{ region }}'
RETURNING
api_id,
api_mapping_id,
api_mapping_key,
stage
;
# Description fields are for documentation purposes
- name: api_mappings
props:
- name: domain_name
value: "{{ domain_name }}"
description: Required parameter for the api_mappings resource.
- name: region
value: "{{ region }}"
description: Required parameter for the api_mappings resource.
- name: ApiId
value: "{{ ApiId }}"
description: |
The identifier.
- name: ApiMappingKey
value: "{{ ApiMappingKey }}"
description: |
After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression's associated selection key type.
- name: Stage
value: "{{ Stage }}"
description: |
A string with a length between [1-128].
UPDATE examples
- update_api_mapping
The API mapping.
UPDATE aws.apigatewayv2.api_mappings
SET
ApiId = '{{ ApiId }}',
ApiMappingKey = '{{ ApiMappingKey }}',
Stage = '{{ Stage }}'
WHERE
api_mapping_id = '{{ api_mapping_id }}' --required
AND domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
AND ApiId = '{{ ApiId }}' --required
RETURNING
api_id,
api_mapping_id,
api_mapping_key,
stage;
DELETE examples
- delete_api_mapping
Deletes an API mapping.
DELETE FROM aws.apigatewayv2.api_mappings
WHERE api_mapping_id = '{{ api_mapping_id }}' --required
AND domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
;