apis
Creates, updates, deletes, gets or lists an apis resource.
Overview
| Name | apis |
| Type | Resource |
| Id | aws.apigatewayv2.apis |
Fields
The following fields are returned by SELECT queries:
- get_api
- get_apis
| Name | Datatype | Description |
|---|---|---|
api_endpoint | string | The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com. The stage name is typically appended to this URI to form a complete path to a deployed API stage. |
api_gateway_managed | boolean | Specifies whether an API is managed by API Gateway. You can't update or delete a managed API by using API Gateway. A managed API can be deleted only through the tooling or service that created it. |
api_id | string | The identifier. |
api_key_selection_expression | string | An expression used to extract information at runtime. See Selection Expressions for more information. |
cors_configuration | object | Represents a CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information. |
created_date | string (date-time) | The timestamp when the API was created. |
description | string | A string with a length between [0-1024]. |
disable_execute_api_endpoint | boolean | Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. |
disable_schema_validation | boolean | Avoid validating models when creating a deployment. Supported only for WebSocket APIs. |
import_info | array | The validation information during API import. This may include particular properties of your OpenAPI definition which are ignored during import. Supported only for HTTP APIs. |
ip_address_type | string | The IP address types that can invoke your API or domain name. (ipv4, dualstack) |
name | string | A string with a length between [1-128]. |
protocol_type | string | Represents a protocol type. (WEBSOCKET, HTTP) |
route_selection_expression | string | An expression used to extract information at runtime. See Selection Expressions for more information. |
tags | object | A collection of tags associated with the API. |
version | string | A string with a length between [1-64]. |
warnings | array | The warning messages reported when failonwarnings is turned on during API import. |
| Name | Datatype | Description |
|---|---|---|
api_endpoint | string | The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com. The stage name is typically appended to this URI to form a complete path to a deployed API stage. |
api_gateway_managed | boolean | Specifies whether an API is managed by API Gateway. You can't update or delete a managed API by using API Gateway. A managed API can be deleted only through the tooling or service that created it. |
api_id | string | The API ID. |
api_key_selection_expression | string | An expression used to extract information at runtime. See Selection Expressions for more information. |
cors_configuration | object | Represents a CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information. |
created_date | string (date-time) | The timestamp when the API was created. |
description | string | A string with a length between [0-1024]. |
disable_execute_api_endpoint | boolean | Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. |
disable_schema_validation | boolean | Avoid validating models when creating a deployment. Supported only for WebSocket APIs. |
import_info | array | The validation information during API import. This may include particular properties of your OpenAPI definition which are ignored during import. Supported only for HTTP APIs. |
ip_address_type | string | The IP address types that can invoke your API or domain name. (ipv4, dualstack) |
name | string | A string with a length between [1-128]. |
protocol_type | string | Represents a protocol type. (WEBSOCKET, HTTP) |
route_selection_expression | string | An expression used to extract information at runtime. See Selection Expressions for more information. |
tags | object | A collection of tags associated with the API. |
version | string | A string with a length between [1-64]. |
warnings | array | The warning messages reported when failonwarnings is turned on during API import. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_api | select | api_id, region | Gets an Api resource. | |
get_apis | select | region | maxResults, nextToken | Gets a collection of Api resources. |
create_api | insert | region, ProtocolType | Creates an Api resource. | |
update_api | update | api_id, region | Updates an Api resource. | |
delete_api | delete | api_id, region | Deletes an Api resource. | |
reimport_api | exec | api_id, region, Body | basepath, failOnWarnings | Puts an Api resource. |
delete_cors_configuration | exec | api_id, region | Deletes a CORS configuration. |
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_id | string | The API identifier. |
region | string | AWS region (default: us-east-1) |
basepath | string | Specifies how to interpret the base path of the API during import. Valid values are ignore, prepend, and split. The default value is ignore. To learn more, see Set the OpenAPI basePath Property. Supported only for HTTP APIs. |
failOnWarnings | boolean | Specifies whether to rollback the API creation when a warning is encountered. By default, API creation continues if a warning is encountered. |
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
- get_apis
Gets an Api resource.
SELECT
api_endpoint,
api_gateway_managed,
api_id,
api_key_selection_expression,
cors_configuration,
created_date,
description,
disable_execute_api_endpoint,
disable_schema_validation,
import_info,
ip_address_type,
name,
protocol_type,
route_selection_expression,
tags,
version,
warnings
FROM aws.apigatewayv2.apis
WHERE api_id = '{{ api_id }}' -- required
AND region = '{{ region }}' -- required
;
Gets a collection of Api resources.
SELECT
api_endpoint,
api_gateway_managed,
api_id,
api_key_selection_expression,
cors_configuration,
created_date,
description,
disable_execute_api_endpoint,
disable_schema_validation,
import_info,
ip_address_type,
name,
protocol_type,
route_selection_expression,
tags,
version,
warnings
FROM aws.apigatewayv2.apis
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_api
- Manifest
Creates an Api resource.
INSERT INTO aws.apigatewayv2.apis (
ApiKeySelectionExpression,
CorsConfiguration,
CredentialsArn,
Description,
DisableSchemaValidation,
DisableExecuteApiEndpoint,
IpAddressType,
Name,
ProtocolType,
RouteKey,
RouteSelectionExpression,
Tags,
Target,
Version,
region
)
SELECT
'{{ ApiKeySelectionExpression }}',
'{{ CorsConfiguration }}',
'{{ CredentialsArn }}',
'{{ Description }}',
{{ DisableSchemaValidation }},
{{ DisableExecuteApiEndpoint }},
'{{ IpAddressType }}',
'{{ Name }}',
'{{ ProtocolType }}' /* required */,
'{{ RouteKey }}',
'{{ RouteSelectionExpression }}',
'{{ Tags }}',
'{{ Target }}',
'{{ Version }}',
'{{ region }}'
RETURNING
api_endpoint,
api_gateway_managed,
api_id,
api_key_selection_expression,
cors_configuration,
created_date,
description,
disable_execute_api_endpoint,
disable_schema_validation,
import_info,
ip_address_type,
name,
protocol_type,
route_selection_expression,
tags,
version,
warnings
;
# Description fields are for documentation purposes
- name: apis
props:
- name: region
value: "{{ region }}"
description: Required parameter for the apis resource.
- name: ApiKeySelectionExpression
value: "{{ ApiKeySelectionExpression }}"
description: |
An expression used to extract information at runtime. See Selection Expressions for more information.
- name: CorsConfiguration
description: |
Represents a CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
value:
AllowCredentials: {{ AllowCredentials }}
AllowHeaders:
- "{{ AllowHeaders }}"
AllowMethods:
- "{{ AllowMethods }}"
AllowOrigins:
- "{{ AllowOrigins }}"
ExposeHeaders:
- "{{ ExposeHeaders }}"
MaxAge: {{ MaxAge }}
- name: CredentialsArn
value: "{{ CredentialsArn }}"
description: |
Represents an Amazon Resource Name (ARN).
- name: Description
value: "{{ Description }}"
description: |
A string with a length between [0-1024].
- name: DisableSchemaValidation
value: {{ DisableSchemaValidation }}
- name: DisableExecuteApiEndpoint
value: {{ DisableExecuteApiEndpoint }}
- name: IpAddressType
value: "{{ IpAddressType }}"
description: |
The IP address types that can invoke your API or domain name.
valid_values: ['ipv4', 'dualstack']
- name: Name
value: "{{ Name }}"
description: |
A string with a length between [1-128].
- name: ProtocolType
value: "{{ ProtocolType }}"
description: |
Represents a protocol type.
valid_values: ['WEBSOCKET', 'HTTP']
- name: RouteKey
value: "{{ RouteKey }}"
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: RouteSelectionExpression
value: "{{ RouteSelectionExpression }}"
description: |
An expression used to extract information at runtime. See Selection Expressions for more information.
- name: Tags
value: "{{ Tags }}"
description: |
Represents a collection of tags associated with the resource.
- name: Target
value: "{{ Target }}"
description: |
A string representation of a URI with a length between [1-2048].
- name: Version
value: "{{ Version }}"
description: |
A string with a length between [1-64].
UPDATE examples
- update_api
Updates an Api resource.
UPDATE aws.apigatewayv2.apis
SET
ApiKeySelectionExpression = '{{ ApiKeySelectionExpression }}',
CorsConfiguration = '{{ CorsConfiguration }}',
CredentialsArn = '{{ CredentialsArn }}',
Description = '{{ Description }}',
DisableSchemaValidation = {{ DisableSchemaValidation }},
DisableExecuteApiEndpoint = {{ DisableExecuteApiEndpoint }},
IpAddressType = '{{ IpAddressType }}',
Name = '{{ Name }}',
RouteKey = '{{ RouteKey }}',
RouteSelectionExpression = '{{ RouteSelectionExpression }}',
Target = '{{ Target }}',
Version = '{{ Version }}'
WHERE
api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
RETURNING
api_endpoint,
api_gateway_managed,
api_id,
api_key_selection_expression,
cors_configuration,
created_date,
description,
disable_execute_api_endpoint,
disable_schema_validation,
import_info,
ip_address_type,
name,
protocol_type,
route_selection_expression,
tags,
version,
warnings;
DELETE examples
- delete_api
Deletes an Api resource.
DELETE FROM aws.apigatewayv2.apis
WHERE api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- reimport_api
- delete_cors_configuration
Puts an Api resource.
EXEC aws.apigatewayv2.apis.reimport_api
@api_id='{{ api_id }}' --required,
@region='{{ region }}' --required,
@basepath='{{ basepath }}',
@failOnWarnings={{ failOnWarnings }}
@@json=
'{
"Body": "{{ Body }}"
}'
;
Deletes a CORS configuration.
EXEC aws.apigatewayv2.apis.delete_cors_configuration
@api_id='{{ api_id }}' --required,
@region='{{ region }}' --required
;