RouteConfiguration
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
ApiKeyRequired:BooleanFunctionArn:StringIntegrationTimeout:IntegerModelSelectionExpression:StringOperationName:StringRequestModels:JsonRequestParameters:JsonRouteResponseSelectionExpression:String
Properties
-
ApiKeyRequired -
Specifies whether an API key is required for this route.
Type: Boolean
Required: No
CloudFormation compatibility: This property is passed directly to the
ApiKeyRequiredproperty of anAWS::ApiGatewayV2::Routeresource. -
FunctionArn -
The ARN of the Lambda function that handles this route. AWS SAM creates an integration and the necessary permissions for API Gateway to invoke the function.
Type: String
Required: Yes
CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.
-
IntegrationTimeout -
The timeout for the integration, in milliseconds. The maximum value is 29,000 milliseconds (29 seconds).
Type: Integer
Required: No
CloudFormation compatibility: This property is passed directly to the
TimeoutInMillisproperty of anAWS::ApiGatewayV2::Integrationresource. -
ModelSelectionExpression -
The model selection expression for the route.
Type: String
Required: No
CloudFormation compatibility: This property is passed directly to the
ModelSelectionExpressionproperty of anAWS::ApiGatewayV2::Routeresource. -
OperationName -
The operation name for the route.
Type: String
Required: No
CloudFormation compatibility: This property is passed directly to the
OperationNameproperty of anAWS::ApiGatewayV2::Routeresource. -
RequestModels -
The request models for the route.
Type: Json
Required: No
CloudFormation compatibility: This property is passed directly to the
RequestModelsproperty of anAWS::ApiGatewayV2::Routeresource. -
RequestParameters -
The request parameters for the route.
Type: Json
Required: No
CloudFormation compatibility: This property is passed directly to the
RequestParametersproperty of anAWS::ApiGatewayV2::Routeresource. -
RouteResponseSelectionExpression -
The route response selection expression for the route.
Type: String
Required: No
CloudFormation compatibility: This property is passed directly to the
RouteResponseSelectionExpressionproperty of anAWS::ApiGatewayV2::Routeresource.
Examples
Simple Route
The following example configures a simple route.
Routes: $connect: FunctionArn: !GetAtt ConnectFunction.Arn sendMessage: FunctionArn: !GetAtt SendMessageFunction.Arn OperationName: SendMessage