route_responses
Creates, updates, deletes or gets a route_response
resource or lists route_responses
in a region
Overview
Name | route_responses |
Type | Resource |
Description | The AWS::ApiGatewayV2::RouteResponse resource creates a route response for a WebSocket API. For more information, see [Set up Route Responses for a WebSocket API in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-route-response.html) in the *API Gateway Developer Guide*. |
Id | aws.apigatewayv2.route_responses |
Fields
Name | Datatype | Description |
---|---|---|
route_response_key | string | The route response key. |
response_parameters | undefined | The route response parameters. |
route_id | string | The route ID. |
model_selection_expression | string | The model selection expression for the route response. Supported only for WebSocket APIs. |
api_id | string | The API identifier. |
response_models | object | The response models for the route response. |
route_response_id | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | RouteResponseKey, RouteId, ApiId, 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 route_responses
in a region.
SELECT
region,
route_response_key,
response_parameters,
route_id,
model_selection_expression,
api_id,
response_models,
route_response_id
FROM aws.apigatewayv2.route_responses
WHERE region = 'us-east-1';
Gets all properties from an individual route_response
.
SELECT
region,
route_response_key,
response_parameters,
route_id,
model_selection_expression,
api_id,
response_models,
route_response_id
FROM aws.apigatewayv2.route_responses
WHERE region = 'us-east-1' AND data__Identifier = '<ApiId>|<RouteId>|<RouteResponseId>';
INSERT
example
Use the following StackQL query and manifest file to create a new route_response
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.apigatewayv2.route_responses (
RouteResponseKey,
RouteId,
ApiId,
region
)
SELECT
'{{ RouteResponseKey }}',
'{{ RouteId }}',
'{{ ApiId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.apigatewayv2.route_responses (
RouteResponseKey,
ResponseParameters,
RouteId,
ModelSelectionExpression,
ApiId,
ResponseModels,
region
)
SELECT
'{{ RouteResponseKey }}',
'{{ ResponseParameters }}',
'{{ RouteId }}',
'{{ ModelSelectionExpression }}',
'{{ ApiId }}',
'{{ ResponseModels }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: route_response
props:
- name: RouteResponseKey
value: '{{ RouteResponseKey }}'
- name: ResponseParameters
value: null
- name: RouteId
value: '{{ RouteId }}'
- name: ModelSelectionExpression
value: '{{ ModelSelectionExpression }}'
- name: ApiId
value: '{{ ApiId }}'
- name: ResponseModels
value: {}
DELETE
example
/*+ delete */
DELETE FROM aws.apigatewayv2.route_responses
WHERE data__Identifier = '<ApiId|RouteId|RouteResponseId>'
AND region = 'us-east-1';
Permissions
To operate on the route_responses
resource, the following permissions are required:
Create
apigateway:POST
Update
apigateway:PATCH,
apigateway:GET,
apigateway:PUT
Read
apigateway:GET
Delete
apigateway:GET,
apigateway:DELETE
List
apigateway:GET