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 in the API Gateway Developer Guide. |
| Id | awscc.apigatewayv2.route_responses |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
route_response_key | string | The route response key. |
response_parameters | object | 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. |
| Name | Datatype | Description |
|---|---|---|
route_id | string | The route ID. |
api_id | string | The API identifier. |
route_response_id | string | |
region | string | AWS region. |
For more information, see AWS::ApiGatewayV2::RouteResponse.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | route_responses | INSERT | RouteResponseKey, RouteId, ApiId, region |
delete_resource | route_responses | DELETE | Identifier, region |
update_resource | route_responses | UPDATE | Identifier, PatchDocument, region |
list_resources | route_responses_list_only | SELECT | region |
get_resource | route_responses | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.apigatewayv2.route_responses
WHERE
region = '{{ region }}' AND
Identifier = '{{ api_id }}|{{ route_id }}|{{ route_response_id }}';
Lists all route_responses in a region.
SELECT
region,
api_id,
route_id,
route_response_id
FROM awscc.apigatewayv2.route_responses_list_only
WHERE
region = '{{ region }}';
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 awscc.apigatewayv2.route_responses (
RouteResponseKey,
RouteId,
ApiId,
region
)
SELECT
'{{ route_response_key }}',
'{{ route_id }}',
'{{ api_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.apigatewayv2.route_responses (
RouteResponseKey,
ResponseParameters,
RouteId,
ModelSelectionExpression,
ApiId,
ResponseModels,
region
)
SELECT
'{{ route_response_key }}',
'{{ response_parameters }}',
'{{ route_id }}',
'{{ model_selection_expression }}',
'{{ api_id }}',
'{{ response_models }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: route_response
props:
- name: route_response_key
value: '{{ route_response_key }}'
- name: response_parameters
value: null
- name: route_id
value: '{{ route_id }}'
- name: model_selection_expression
value: '{{ model_selection_expression }}'
- name: api_id
value: '{{ api_id }}'
- name: response_models
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a route_response resource, using stack-deploy.
/*+ update */
UPDATE awscc.apigatewayv2.route_responses
SET PatchDocument = string('{{ {
"RouteResponseKey": route_response_key,
"ResponseParameters": response_parameters,
"ModelSelectionExpression": model_selection_expression,
"ResponseModels": response_models
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ api_id }}|{{ route_id }}|{{ route_response_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.apigatewayv2.route_responses
WHERE
Identifier = '{{ api_id }}|{{ route_id }}|{{ route_response_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the route_responses resource, the following permissions are required:
- Create
- Update
- Read
- Delete
- List
apigateway:POST
apigateway:PATCH,
apigateway:GET,
apigateway:PUT
apigateway:GET
apigateway:GET,
apigateway:DELETE
apigateway:GET