interface CfnRouteProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGatewayv2.CfnRouteProps |
Java | software.amazon.awscdk.services.apigatewayv2.CfnRouteProps |
Python | aws_cdk.aws_apigatewayv2.CfnRouteProps |
TypeScript | @aws-cdk/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 * as apigatewayv2 from '@aws-cdk/aws-apigatewayv2';
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
Name | Type | Description |
---|---|---|
api | string | The API identifier. |
route | string | The route key for the route. |
api | boolean | IResolvable | Specifies whether an API key is required for the route. |
authorization | string[] | The authorization scopes supported by this route. |
authorization | string | The authorization type for the route. |
authorizer | string | The identifier of the Authorizer resource to be associated with this route. |
model | string | The model selection expression for the route. |
operation | string | The operation name for the route. |
request | any | The request models for the route. |
request | any | The request parameters for the route. |
route | string | The route response selection expression for the route. |
target? | string | The 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.