gateway_responses
Creates, updates, deletes or gets a gateway_response
resource or lists gateway_responses
in a region
Overview
Name | gateway_responses |
Type | Resource |
Description | The 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*. |
Id | aws.apigateway.gateway_responses |
Fields
Name | Datatype | Description |
---|---|---|
id | string | |
rest_api_id | string | The string identifier of the associated RestApi. |
response_type | string | The response type of the associated GatewayResponse. |
status_code | string | The HTTP status code for this GatewayResponse. |
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. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ResponseType, RestApiId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.apigateway.gateway_responses (
RestApiId,
ResponseType,
region
)
SELECT
'{{ RestApiId }}',
'{{ ResponseType }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.apigateway.gateway_responses (
RestApiId,
ResponseType,
StatusCode,
ResponseParameters,
ResponseTemplates,
region
)
SELECT
'{{ RestApiId }}',
'{{ ResponseType }}',
'{{ StatusCode }}',
'{{ ResponseParameters }}',
'{{ ResponseTemplates }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: gateway_response
props:
- name: RestApiId
value: '{{ RestApiId }}'
- name: ResponseType
value: '{{ ResponseType }}'
- name: StatusCode
value: '{{ StatusCode }}'
- name: ResponseParameters
value: {}
- name: ResponseTemplates
value: {}
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