Skip to main content

gateway_responses

Creates, updates, deletes or gets a gateway_response resource or lists gateway_responses in a region

Overview

Namegateway_responses
TypeResource
DescriptionThe AWS::ApiGateway::GatewayResponse resource creates a gateway response for your API. For more information, see [API Gateway Responses](https://docs.aws.amazon.com/apigateway/latest/developerguide/customize-gateway-responses.html#api-gateway-gatewayResponse-definition) in the *API Gateway Developer Guide*.
Idaws.apigateway.gateway_responses

Fields

NameDatatypeDescription
idstring
rest_api_idstringThe string identifier of the associated RestApi.
response_typestringThe response type of the associated GatewayResponse.
status_codestringThe HTTP status code for this GatewayResponse.
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.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTResponseType, RestApiId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all gateway_responses in a region.

SELECT
region,
id,
rest_api_id,
response_type,
status_code,
response_parameters,
response_templates
FROM aws.apigateway.gateway_responses
WHERE region = 'us-east-1';

Gets all properties from an individual gateway_response.

SELECT
region,
id,
rest_api_id,
response_type,
status_code,
response_parameters,
response_templates
FROM aws.apigateway.gateway_responses
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

Use the following StackQL query and manifest file to create a new gateway_response resource, using stack-deploy.

/*+ create */
INSERT INTO aws.apigateway.gateway_responses (
RestApiId,
ResponseType,
region
)
SELECT
'{{ RestApiId }}',
'{{ ResponseType }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.apigateway.gateway_responses
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

To operate on the gateway_responses resource, the following permissions are required:

Create

apigateway:PUT,
apigateway:GET

Read

apigateway:GET

Update

apigateway:GET,
apigateway:PUT

Delete

apigateway:GET,
apigateway:DELETE

List

apigateway:GET