AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ApiGatewayV2::RouteResponse

CfnRouteResponse

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* .

Import

import { CfnRouteResponse } from 'aws-cdk-lib/aws-apigatewayv2';

Or use the module namespace:

import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
// apigatewayv2.CfnRouteResponse

Properties

Configuration passed to the constructor as CfnRouteResponseProps.

apiIdRequired
string | IApiRef

The API identifier.

routeIdRequired
string | IRouteRef

The route ID.

routeResponseKeyRequired
string

The route response key.

modelSelectionExpressionOptional
string

The model selection expression for the route response. Supported only for WebSocket APIs.

responseModelsOptional
any

The response models for the route response.

responseParametersOptional
IResolvable | { [key: string]: IResolvable | ParameterConstraintsProperty }

The route response parameters.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter