AWS::ApiGatewayV2::RouteThe `AWS::ApiGatewayV2::Route` resource creates a route for an API.
import { CfnRoute } from 'aws-cdk-lib/aws-apigatewayv2';Or use the module namespace:
import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
// apigatewayv2.CfnRouteConfiguration passed to the constructor as CfnRouteProps.
apiIdRequiredstring | IApiRefThe API identifier.
routeKeyRequiredstringThe route key for the route. For HTTP APIs, the route key can be either `$default` , or a combination of an HTTP method and resource path, for example, `GET /pets` .
apiKeyRequiredOptionalboolean | IResolvableSpecifies whether an API key is required for the route. Supported only for WebSocket APIs.
authorizationScopesOptionalstring[]The authorization scopes supported by this route.
authorizationTypeOptionalstringThe authorization type for the route. For WebSocket APIs, valid values are `NONE` for open access, `AWS_IAM` for using AWS IAM permissions, and `CUSTOM` for using a Lambda authorizer. For HTTP APIs, valid values are `NONE` for open access, `JWT` for using JSON Web Tokens, `AWS_IAM` for using AWS IAM permissions, and `CUSTOM` for using a Lambda authorizer.
authorizerIdOptionalstring | IAuthorizerRefThe identifier of the `Authorizer` resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.
modelSelectionExpressionOptionalstringThe model selection expression for the route. Supported only for WebSocket APIs.
operationNameOptionalstringThe operation name for the route.
requestModelsOptionalanyThe request models for the route. Supported only for WebSocket APIs.
requestParametersOptionalanyThe request parameters for the route. Supported only for WebSocket APIs.
routeResponseSelectionExpressionOptionalstringThe route response selection expression for the route. Supported only for WebSocket APIs.
targetOptionalstring | IIntegrationRefThe target for the route.
This L1 construct maps directly to the following CloudFormation resource type.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-apigatewayv2AWS::ApiGatewayV2::Route