AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ApiGatewayV2::RoutingRule

CfnRoutingRule

Represents a routing rule. When the incoming request to a domain name matches the conditions for a rule, API Gateway invokes a stage of a target API. Supported only for REST APIs.

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as CfnRoutingRuleProps.

actionsRequired
IResolvable | IResolvable | ActionProperty[]

The resulting action based on matching a routing rules condition. Only InvokeApi is supported.

conditionsRequired
IResolvable | IResolvable | ConditionProperty[]

The conditions of the routing rule.

domainNameArnRequired
string

The ARN of the domain name.

priorityRequired
number

The order in which API Gateway evaluates a rule. Priority is evaluated from the lowest value to the highest value. Rules can't have the same priority. Priority values 1-1,000,000 are supported.

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