aws-cdk-lib.aws_apigatewayv2.CfnRouteProps

interface CfnRouteProps

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.CfnRouteProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#CfnRouteProps
Javasoftware.amazon.awscdk.services.apigatewayv2.CfnRouteProps
Pythonaws_cdk.aws_apigatewayv2.CfnRouteProps
TypeScript aws-cdk-lib » aws_apigatewayv2 » CfnRouteProps

Properties for defining a CfnRoute.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';

declare const requestModels: any;
declare const requestParameters: any;
const cfnRouteProps: apigatewayv2.CfnRouteProps = {
  apiId: 'apiId',
  routeKey: 'routeKey',

  // the properties below are optional
  apiKeyRequired: false,
  authorizationScopes: ['authorizationScopes'],
  authorizationType: 'authorizationType',
  authorizerId: 'authorizerId',
  modelSelectionExpression: 'modelSelectionExpression',
  operationName: 'operationName',
  requestModels: requestModels,
  requestParameters: requestParameters,
  routeResponseSelectionExpression: 'routeResponseSelectionExpression',
  target: 'target',
};

Properties

NameTypeDescription
apiIdstringThe API identifier.
routeKeystringThe route key for the route.
apiKeyRequired?boolean | IResolvableSpecifies whether an API key is required for the route.
authorizationScopes?string[]The authorization scopes supported by this route.
authorizationType?stringThe authorization type for the route.
authorizerId?stringThe identifier of the Authorizer resource to be associated with this route.
modelSelectionExpression?stringThe model selection expression for the route.
operationName?stringThe operation name for the route.
requestModels?anyThe request models for the route.
requestParameters?anyThe request parameters for the route.
routeResponseSelectionExpression?stringThe route response selection expression for the route.
target?stringThe target for the route.

apiId

Type: string

The API identifier.


routeKey

Type: string

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


apiKeyRequired?

Type: boolean | IResolvable (optional)

Specifies whether an API key is required for the route.

Supported only for WebSocket APIs.


authorizationScopes?

Type: string[] (optional)

The authorization scopes supported by this route.


authorizationType?

Type: string (optional)

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


authorizerId?

Type: string (optional)

The identifier of the Authorizer resource to be associated with this route.

The authorizer identifier is generated by API Gateway when you created the authorizer.


modelSelectionExpression?

Type: string (optional)

The model selection expression for the route.

Supported only for WebSocket APIs.


operationName?

Type: string (optional)

The operation name for the route.


requestModels?

Type: any (optional)

The request models for the route.

Supported only for WebSocket APIs.


requestParameters?

Type: any (optional)

The request parameters for the route.

Supported only for WebSocket APIs.


routeResponseSelectionExpression?

Type: string (optional)

The route response selection expression for the route.

Supported only for WebSocket APIs.


target?

Type: string (optional)

The target for the route.