Skip to main content

gateway_responses

Creates, updates, deletes, gets or lists a gateway_responses resource.

Overview

Namegateway_responses
TypeResource
Idaws.apigateway.gateway_responses

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
default_responsebooleanA 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_parametersobjectResponse parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
response_templatesobjectResponse templates of the GatewayResponse as a string-to-string map of key-value pairs.
response_typestringThe 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_codestringThe HTTP status code for this GatewayResponse. (pattern: <code>[1-5]\d\d</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_gateway_responseselectrestapi_id, response_type, regionGets a GatewayResponse of a specified response type on the given RestApi.
get_gateway_responsesselectrestapi_id, regionposition, limitGets 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_responseupdaterestapi_id, response_type, regionUpdates a GatewayResponse of a specified response type on the given RestApi.
put_gateway_responsereplacerestapi_id, response_type, regionCreates a customization of a GatewayResponse of a specified response type and status code on the given RestApi.
delete_gateway_responsedeleterestapi_id, response_type, regionClears 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
response_typestringThe response type of the associated GatewayResponse.
restapi_idstringThe string identifier of the associated RestApi.
limitintegerThe 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.
positionstringThe current pagination position in the paged result set. The GatewayResponse collection does not support pagination and the position does not apply here.

SELECT examples

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
;

UPDATE examples

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

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

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
;