Skip to main content

route_responses

Creates, updates, deletes or gets a route_response resource or lists route_responses in a region

Overview

Nameroute_responses
TypeResource
DescriptionThe 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.
Idawscc.apigatewayv2.route_responses

Fields

NameDatatypeDescription
route_response_keystringThe route response key.
response_parametersobjectThe route response parameters.
route_idstringThe route ID.
model_selection_expressionstringThe model selection expression for the route response. Supported only for WebSocket APIs.
api_idstringThe API identifier.
response_modelsobjectThe response models for the route response.
route_response_idstring
regionstringAWS region.

For more information, see AWS::ApiGatewayV2::RouteResponse.

Methods

NameResourceAccessible byRequired Params
create_resourceroute_responsesINSERTRouteResponseKey, RouteId, ApiId, region
delete_resourceroute_responsesDELETEIdentifier, region
update_resourceroute_responsesUPDATEIdentifier, PatchDocument, region
list_resourcesroute_responses_list_onlySELECTregion
get_resourceroute_responsesSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

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

/*+ 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
;

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:

ParameterDescription
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:

apigateway:POST