gateway_responses
Creates, updates, deletes, gets or lists a gateway_responses resource.
Overview
| Name | gateway_responses |
| Type | Resource |
| Id | aws.apigateway.gateway_responses |
Fields
The following fields are returned by SELECT queries:
- get_gateway_response
- get_gateway_responses
| Name | Datatype | Description |
|---|---|---|
default_response | boolean | A Boolean flag to indicate whether this GatewayResponse is the default gateway response (true) or not (false). A default gateway response is one generated by API Gateway without any customization by an API developer. |
response_parameters | object | Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs. |
response_templates | object | Response templates of the GatewayResponse as a string-to-string map of key-value pairs. |
response_type | string | The response type of the associated GatewayResponse. (DEFAULT_4XX, DEFAULT_5XX, RESOURCE_NOT_FOUND, UNAUTHORIZED, INVALID_API_KEY, ACCESS_DENIED, AUTHORIZER_FAILURE, AUTHORIZER_CONFIGURATION_ERROR, INVALID_SIGNATURE, EXPIRED_TOKEN, MISSING_AUTHENTICATION_TOKEN, INTEGRATION_FAILURE, INTEGRATION_TIMEOUT, API_CONFIGURATION_ERROR, UNSUPPORTED_MEDIA_TYPE, BAD_REQUEST_PARAMETERS, BAD_REQUEST_BODY, REQUEST_TOO_LARGE, THROTTLED, QUOTA_EXCEEDED, WAF_FILTERED) |
status_code | string | The HTTP status code for this GatewayResponse. (pattern: <code>[1-5]\d\d</code>) |
| Name | Datatype | Description |
|---|---|---|
default_response | boolean | A Boolean flag to indicate whether this GatewayResponse is the default gateway response (true) or not (false). A default gateway response is one generated by API Gateway without any customization by an API developer. |
response_parameters | object | Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs. |
response_templates | object | Response templates of the GatewayResponse as a string-to-string map of key-value pairs. |
response_type | string | The response type of the associated GatewayResponse. (DEFAULT_4XX, DEFAULT_5XX, RESOURCE_NOT_FOUND, UNAUTHORIZED, INVALID_API_KEY, ACCESS_DENIED, AUTHORIZER_FAILURE, AUTHORIZER_CONFIGURATION_ERROR, INVALID_SIGNATURE, EXPIRED_TOKEN, MISSING_AUTHENTICATION_TOKEN, INTEGRATION_FAILURE, INTEGRATION_TIMEOUT, API_CONFIGURATION_ERROR, UNSUPPORTED_MEDIA_TYPE, BAD_REQUEST_PARAMETERS, BAD_REQUEST_BODY, REQUEST_TOO_LARGE, THROTTLED, QUOTA_EXCEEDED, WAF_FILTERED) |
status_code | string | The HTTP status code for this GatewayResponse. (pattern: <code>[1-5]\d\d</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_gateway_response | select | restapi_id, response_type, region | Gets a GatewayResponse of a specified response type on the given RestApi. | |
get_gateway_responses | select | restapi_id, region | position, limit | Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types. |
update_gateway_response | update | restapi_id, response_type, region | Updates a GatewayResponse of a specified response type on the given RestApi. | |
put_gateway_response | replace | restapi_id, response_type, region | Creates a customization of a GatewayResponse of a specified response type and status code on the given RestApi. | |
delete_gateway_response | delete | restapi_id, response_type, region | Clears any customization of a GatewayResponse of a specified response type on the given RestApi and resets it with the default settings. |
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) |
response_type | string | The response type of the associated GatewayResponse. |
restapi_id | string | The string identifier of the associated RestApi. |
limit | integer | The maximum number of returned results per page. The default value is 25 and the maximum value is 500. The GatewayResponses collection does not support pagination and the limit does not apply here. |
position | string | The current pagination position in the paged result set. The GatewayResponse collection does not support pagination and the position does not apply here. |
SELECT examples
- get_gateway_response
- get_gateway_responses
Gets a GatewayResponse of a specified response type on the given RestApi.
SELECT
default_response,
response_parameters,
response_templates,
response_type,
status_code
FROM aws.apigateway.gateway_responses
WHERE restapi_id = '{{ restapi_id }}' -- required
AND response_type = '{{ response_type }}' -- required
AND region = '{{ region }}' -- required
;
Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types.
SELECT
default_response,
response_parameters,
response_templates,
response_type,
status_code
FROM aws.apigateway.gateway_responses
WHERE restapi_id = '{{ restapi_id }}' -- required
AND region = '{{ region }}' -- required
AND position = '{{ position }}'
AND limit = '{{ limit }}'
;
UPDATE examples
- update_gateway_response
Updates a GatewayResponse of a specified response type on the given RestApi.
UPDATE aws.apigateway.gateway_responses
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND response_type = '{{ response_type }}' --required
AND region = '{{ region }}' --required
RETURNING
default_response,
response_parameters,
response_templates,
response_type,
status_code;
REPLACE examples
- put_gateway_response
Creates a customization of a GatewayResponse of a specified response type and status code on the given RestApi.
REPLACE aws.apigateway.gateway_responses
SET
statusCode = '{{ statusCode }}',
responseParameters = '{{ responseParameters }}',
responseTemplates = '{{ responseTemplates }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND response_type = '{{ response_type }}' --required
AND region = '{{ region }}' --required
RETURNING
default_response,
response_parameters,
response_templates,
response_type,
status_code;
DELETE examples
- delete_gateway_response
Clears any customization of a GatewayResponse of a specified response type on the given RestApi and resets it with the default settings.
DELETE FROM aws.apigateway.gateway_responses
WHERE restapi_id = '{{ restapi_id }}' --required
AND response_type = '{{ response_type }}' --required
AND region = '{{ region }}' --required
;