rest_apis
Creates, updates, deletes, gets or lists a rest_apis resource.
Overview
| Name | rest_apis |
| Type | Resource |
| Id | aws.apigateway.rest_apis |
Fields
The following fields are returned by SELECT queries:
- get_rest_api
- get_rest_apis
| Name | Datatype | Description |
|---|---|---|
id | string | The API's identifier. This identifier is unique across all of your APIs in API Gateway. |
name | string | The API's name. |
api_key_source | string | The source of the API key for metering requests according to a usage plan. Valid values are: >HEADER to read the API key from the X-API-Key header of a request. AUTHORIZER to read the API key from the UsageIdentifierKey from a custom authorizer. (HEADER, AUTHORIZER) |
api_status | string | The ApiStatus of the RestApi. (UPDATING, AVAILABLE, PENDING, FAILED) |
api_status_message | string | The status message of the RestApi. When the status message is UPDATING you can still invoke it. |
binary_media_types | array | The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads. |
created_date | string (date-time) | The timestamp when the API was created. |
description | string | The API's description. |
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. |
endpoint_access_mode | string | The endpoint access mode of the RestApi. (BASIC, STRICT) |
endpoint_configuration | object | The endpoint configuration to indicate the types of endpoints an API (RestApi) or its custom domain name (DomainName) has and the IP address types that can invoke it. |
minimum_compression_size | integer | A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size. |
policy | string | A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration. |
root_resource_id | string | The API's root resource ID. |
security_policy | string | The Transport Layer Security (TLS) version + cipher suite for this RestApi. (TLS_1_0, TLS_1_2, SecurityPolicy_TLS13_1_3_2025_09, SecurityPolicy_TLS13_1_3_FIPS_2025_09, SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09, SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09, SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09, SecurityPolicy_TLS13_1_2_PQ_2025_09, SecurityPolicy_TLS13_1_2_2021_06, SecurityPolicy_TLS13_2025_EDGE, SecurityPolicy_TLS12_PFS_2025_EDGE, SecurityPolicy_TLS12_2018_EDGE) |
tags | object | The collection of tags. Each tag element is associated with a given resource. |
version | string | A version identifier for the API. |
warnings | array | The warning messages reported when failonwarnings is turned on during API import. |
| Name | Datatype | Description |
|---|---|---|
id | string | The API's identifier. This identifier is unique across all of your APIs in API Gateway. |
name | string | The API's name. |
api_key_source | string | The source of the API key for metering requests according to a usage plan. Valid values are: >HEADER to read the API key from the X-API-Key header of a request. AUTHORIZER to read the API key from the UsageIdentifierKey from a custom authorizer. (HEADER, AUTHORIZER) |
api_status | string | The ApiStatus of the RestApi. (UPDATING, AVAILABLE, PENDING, FAILED) |
api_status_message | string | The status message of the RestApi. When the status message is UPDATING you can still invoke it. |
binary_media_types | array | The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads. |
created_date | string (date-time) | The timestamp when the API was created. |
description | string | The API's description. |
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. |
endpoint_access_mode | string | The endpoint access mode of the RestApi. (BASIC, STRICT) |
endpoint_configuration | object | The endpoint configuration to indicate the types of endpoints an API (RestApi) or its custom domain name (DomainName) has and the IP address types that can invoke it. |
minimum_compression_size | integer | A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size. |
policy | string | A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration. |
root_resource_id | string | The API's root resource ID. |
security_policy | string | The Transport Layer Security (TLS) version + cipher suite for this RestApi. (TLS_1_0, TLS_1_2, SecurityPolicy_TLS13_1_3_2025_09, SecurityPolicy_TLS13_1_3_FIPS_2025_09, SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09, SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09, SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09, SecurityPolicy_TLS13_1_2_PQ_2025_09, SecurityPolicy_TLS13_1_2_2021_06, SecurityPolicy_TLS13_2025_EDGE, SecurityPolicy_TLS12_PFS_2025_EDGE, SecurityPolicy_TLS12_2018_EDGE) |
tags | object | The collection of tags. Each tag element is associated with a given resource. |
version | string | A version identifier for the API. |
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_rest_api | select | restapi_id, region | Lists the RestApi resource in the collection. | |
get_rest_apis | select | region | position, limit | Lists the RestApis resources for your collection. |
create_rest_api | insert | region, name | Creates a new RestApi resource. | |
update_rest_api | update | restapi_id, region | Changes information about the specified API. | |
put_rest_api | replace | restapi_id, region, body | mode, failonwarnings, parameters | A feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API. |
delete_rest_api | delete | restapi_id, region | Deletes the specified API. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
restapi_id | string | The string identifier of the associated RestApi. |
failonwarnings | boolean | A query parameter to indicate whether to rollback the API update (true) or not (false) when a warning is encountered. The default value is false. |
limit | integer | The maximum number of returned results per page. The default value is 25 and the maximum value is 500. |
mode | string | The mode query parameter to specify the update mode. Valid values are "merge" and "overwrite". By default, the update mode is "merge". |
parameters | object | Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set ignore=documentation as a parameters value, as in the AWS CLI command of aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'. |
position | string | The current pagination position in the paged result set. |
SELECT examples
- get_rest_api
- get_rest_apis
Lists the RestApi resource in the collection.
SELECT
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings
FROM aws.apigateway.rest_apis
WHERE restapi_id = '{{ restapi_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists the RestApis resources for your collection.
SELECT
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings
FROM aws.apigateway.rest_apis
WHERE region = '{{ region }}' -- required
AND position = '{{ position }}'
AND limit = '{{ limit }}'
;
INSERT examples
- create_rest_api
- Manifest
Creates a new RestApi resource.
INSERT INTO aws.apigateway.rest_apis (
name,
description,
version,
cloneFrom,
binaryMediaTypes,
minimumCompressionSize,
apiKeySource,
endpointConfiguration,
policy,
tags,
disableExecuteApiEndpoint,
securityPolicy,
endpointAccessMode,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ version }}',
'{{ cloneFrom }}',
'{{ binaryMediaTypes }}',
{{ minimumCompressionSize }},
'{{ apiKeySource }}',
'{{ endpointConfiguration }}',
'{{ policy }}',
'{{ tags }}',
{{ disableExecuteApiEndpoint }},
'{{ securityPolicy }}',
'{{ endpointAccessMode }}',
'{{ region }}'
RETURNING
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings
;
# Description fields are for documentation purposes
- name: rest_apis
props:
- name: region
value: "{{ region }}"
description: Required parameter for the rest_apis resource.
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: version
value: "{{ version }}"
- name: cloneFrom
value: "{{ cloneFrom }}"
- name: binaryMediaTypes
value:
- "{{ binaryMediaTypes }}"
- name: minimumCompressionSize
value: {{ minimumCompressionSize }}
- name: apiKeySource
value: "{{ apiKeySource }}"
valid_values: ['HEADER', 'AUTHORIZER']
- name: endpointConfiguration
description: |
The endpoint configuration to indicate the types of endpoints an API (RestApi) or its custom domain name (DomainName) has and the IP address types that can invoke it.
value:
types:
- "{{ types }}"
ipAddressType: "{{ ipAddressType }}"
vpcEndpointIds:
- "{{ vpcEndpointIds }}"
- name: policy
value: "{{ policy }}"
- name: tags
value: "{{ tags }}"
- name: disableExecuteApiEndpoint
value: {{ disableExecuteApiEndpoint }}
- name: securityPolicy
value: "{{ securityPolicy }}"
valid_values: ['TLS_1_0', 'TLS_1_2', 'SecurityPolicy_TLS13_1_3_2025_09', 'SecurityPolicy_TLS13_1_3_FIPS_2025_09', 'SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09', 'SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09', 'SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09', 'SecurityPolicy_TLS13_1_2_PQ_2025_09', 'SecurityPolicy_TLS13_1_2_2021_06', 'SecurityPolicy_TLS13_2025_EDGE', 'SecurityPolicy_TLS12_PFS_2025_EDGE', 'SecurityPolicy_TLS12_2018_EDGE']
- name: endpointAccessMode
value: "{{ endpointAccessMode }}"
valid_values: ['BASIC', 'STRICT']
UPDATE examples
- update_rest_api
Changes information about the specified API.
UPDATE aws.apigateway.rest_apis
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings;
REPLACE examples
- put_rest_api
A feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API.
REPLACE aws.apigateway.rest_apis
SET
body = '{{ body }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND region = '{{ region }}' --required
AND body = '{{ body }}' --required
AND mode = '{{ mode}}'
AND failonwarnings = {{ failonwarnings}}
AND parameters = '{{ parameters}}'
RETURNING
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings;
DELETE examples
- delete_rest_api
Deletes the specified API.
DELETE FROM aws.apigateway.rest_apis
WHERE restapi_id = '{{ restapi_id }}' --required
AND region = '{{ region }}' --required
;