We recommend new projects start with resources from the AWS provider.
published on Monday, Jun 15, 2026 by Pulumi
We recommend new projects start with resources from the AWS provider.
published on Monday, Jun 15, 2026 by Pulumi
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.
Create RoutingRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RoutingRule(name: string, args: RoutingRuleArgs, opts?: CustomResourceOptions);@overload
def RoutingRule(resource_name: str,
args: RoutingRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RoutingRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
actions: Optional[Sequence[RoutingRuleActionArgs]] = None,
conditions: Optional[Sequence[RoutingRuleConditionArgs]] = None,
domain_name_arn: Optional[str] = None,
priority: Optional[int] = None)func NewRoutingRule(ctx *Context, name string, args RoutingRuleArgs, opts ...ResourceOption) (*RoutingRule, error)public RoutingRule(string name, RoutingRuleArgs args, CustomResourceOptions? opts = null)
public RoutingRule(String name, RoutingRuleArgs args)
public RoutingRule(String name, RoutingRuleArgs args, CustomResourceOptions options)
type: aws-native:apigatewayv2:RoutingRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws-native_apigatewayv2_routingrule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args RoutingRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RoutingRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RoutingRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RoutingRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RoutingRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RoutingRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RoutingRule resource accepts the following input properties:
- Actions
List<Pulumi.
Aws Native. Api Gateway V2. Inputs. Routing Rule Action> - The resulting action based on matching a routing rules condition. Only InvokeApi is supported.
- Conditions
List<Pulumi.
Aws Native. Api Gateway V2. Inputs. Routing Rule Condition> - The conditions of the routing rule.
- Domain
Name stringArn - The ARN of the domain name.
- Priority int
- 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.
- Actions
[]Routing
Rule Action Args - The resulting action based on matching a routing rules condition. Only InvokeApi is supported.
- Conditions
[]Routing
Rule Condition Args - The conditions of the routing rule.
- Domain
Name stringArn - The ARN of the domain name.
- Priority int
- 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.
- actions list(object)
- The resulting action based on matching a routing rules condition. Only InvokeApi is supported.
- conditions list(object)
- The conditions of the routing rule.
- domain_
name_ stringarn - The ARN of the domain name.
- priority 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.
- actions
List<Routing
Rule Action> - The resulting action based on matching a routing rules condition. Only InvokeApi is supported.
- conditions
List<Routing
Rule Condition> - The conditions of the routing rule.
- domain
Name StringArn - The ARN of the domain name.
- priority Integer
- 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.
- actions
Routing
Rule Action[] - The resulting action based on matching a routing rules condition. Only InvokeApi is supported.
- conditions
Routing
Rule Condition[] - The conditions of the routing rule.
- domain
Name stringArn - The ARN of the domain name.
- priority 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.
- actions
Sequence[Routing
Rule Action Args] - The resulting action based on matching a routing rules condition. Only InvokeApi is supported.
- conditions
Sequence[Routing
Rule Condition Args] - The conditions of the routing rule.
- domain_
name_ strarn - The ARN of the domain name.
- priority int
- 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.
- actions List<Property Map>
- The resulting action based on matching a routing rules condition. Only InvokeApi is supported.
- conditions List<Property Map>
- The conditions of the routing rule.
- domain
Name StringArn - The ARN of the domain name.
- priority 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the RoutingRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Routing
Rule stringArn - Represents an Amazon Resource Name (ARN).
- Routing
Rule stringId - The identifier.
- Id string
- The provider-assigned unique ID for this managed resource.
- Routing
Rule stringArn - Represents an Amazon Resource Name (ARN).
- Routing
Rule stringId - The identifier.
- id string
- The provider-assigned unique ID for this managed resource.
- routing_
rule_ stringarn - Represents an Amazon Resource Name (ARN).
- routing_
rule_ stringid - The identifier.
- id String
- The provider-assigned unique ID for this managed resource.
- routing
Rule StringArn - Represents an Amazon Resource Name (ARN).
- routing
Rule StringId - The identifier.
- id string
- The provider-assigned unique ID for this managed resource.
- routing
Rule stringArn - Represents an Amazon Resource Name (ARN).
- routing
Rule stringId - The identifier.
- id str
- The provider-assigned unique ID for this managed resource.
- routing_
rule_ strarn - Represents an Amazon Resource Name (ARN).
- routing_
rule_ strid - The identifier.
- id String
- The provider-assigned unique ID for this managed resource.
- routing
Rule StringArn - Represents an Amazon Resource Name (ARN).
- routing
Rule StringId - The identifier.
Supporting Types
RoutingRuleAction, RoutingRuleActionArgs
Represents a routing rule action. The only supported action is invokeApi.- Invoke
Api Pulumi.Aws Native. Api Gateway V2. Inputs. Routing Rule Action Invoke Api - Represents an InvokeApi action.
- Invoke
Api RoutingRule Action Invoke Api - Represents an InvokeApi action.
- invoke_
api object - Represents an InvokeApi action.
- invoke
Api RoutingRule Action Invoke Api - Represents an InvokeApi action.
- invoke
Api RoutingRule Action Invoke Api - Represents an InvokeApi action.
- invoke_
api RoutingRule Action Invoke Api - Represents an InvokeApi action.
- invoke
Api Property Map - Represents an InvokeApi action.
RoutingRuleActionInvokeApi, RoutingRuleActionInvokeApiArgs
Represents an InvokeApi action.- Api
Id string - The API identifier of the target API.
- Stage string
- The name of the target stage.
- Strip
Base boolPath - The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.
- Api
Id string - The API identifier of the target API.
- Stage string
- The name of the target stage.
- Strip
Base boolPath - The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.
- api_
id string - The API identifier of the target API.
- stage string
- The name of the target stage.
- strip_
base_ boolpath - The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.
- api
Id String - The API identifier of the target API.
- stage String
- The name of the target stage.
- strip
Base BooleanPath - The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.
- api
Id string - The API identifier of the target API.
- stage string
- The name of the target stage.
- strip
Base booleanPath - The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.
- api_
id str - The API identifier of the target API.
- stage str
- The name of the target stage.
- strip_
base_ boolpath - The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.
- api
Id String - The API identifier of the target API.
- stage String
- The name of the target stage.
- strip
Base BooleanPath - The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.
RoutingRuleCondition, RoutingRuleConditionArgs
Represents a condition. Conditions can contain up to two matchHeaders conditions and one matchBasePaths conditions. API Gateway evaluates header conditions and base path conditions together. You can only use AND between header and base path conditions.- Match
Base Pulumi.Paths Aws Native. Api Gateway V2. Inputs. Routing Rule Match Base Paths - The base path to be matched.
- Match
Headers Pulumi.Aws Native. Api Gateway V2. Inputs. Routing Rule Match Headers - The headers to be matched.
- Match
Base RoutingPaths Rule Match Base Paths - The base path to be matched.
- Match
Headers RoutingRule Match Headers - The headers to be matched.
- match_
base_ objectpaths - The base path to be matched.
- match_
headers object - The headers to be matched.
- match
Base RoutingPaths Rule Match Base Paths - The base path to be matched.
- match
Headers RoutingRule Match Headers - The headers to be matched.
- match
Base RoutingPaths Rule Match Base Paths - The base path to be matched.
- match
Headers RoutingRule Match Headers - The headers to be matched.
- match_
base_ Routingpaths Rule Match Base Paths - The base path to be matched.
- match_
headers RoutingRule Match Headers - The headers to be matched.
- match
Base Property MapPaths - The base path to be matched.
- match
Headers Property Map - The headers to be matched.
RoutingRuleMatchBasePaths, RoutingRuleMatchBasePathsArgs
Represents a MatchBasePaths condition.- Any
Of List<string> - The string of the case sensitive base path to be matched.
- Any
Of []string - The string of the case sensitive base path to be matched.
- any_
of list(string) - The string of the case sensitive base path to be matched.
- any
Of List<String> - The string of the case sensitive base path to be matched.
- any
Of string[] - The string of the case sensitive base path to be matched.
- any_
of Sequence[str] - The string of the case sensitive base path to be matched.
- any
Of List<String> - The string of the case sensitive base path to be matched.
RoutingRuleMatchHeaderValue, RoutingRuleMatchHeaderValueArgs
Represents a MatchHeaderValue.- Header string
- The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~.. - Value
Glob string - The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~. Wildcard matching is supported for header glob values but must be for*prefix-match,suffix-match*, or*infix*-match.
- Header string
- The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~.. - Value
Glob string - The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~. Wildcard matching is supported for header glob values but must be for*prefix-match,suffix-match*, or*infix*-match.
- header string
- The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~.. - value_
glob string - The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~. Wildcard matching is supported for header glob values but must be for*prefix-match,suffix-match*, or*infix*-match.
- header String
- The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~.. - value
Glob String - The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~. Wildcard matching is supported for header glob values but must be for*prefix-match,suffix-match*, or*infix*-match.
- header string
- The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~.. - value
Glob string - The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~. Wildcard matching is supported for header glob values but must be for*prefix-match,suffix-match*, or*infix*-match.
- header str
- The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~.. - value_
glob str - The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~. Wildcard matching is supported for header glob values but must be for*prefix-match,suffix-match*, or*infix*-match.
- header String
- The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~.. - value
Glob String - The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are
a-z,A-Z,0-9, and the following special characters:*?-!#$%&'.^_`|~. Wildcard matching is supported for header glob values but must be for*prefix-match,suffix-match*, or*infix*-match.
RoutingRuleMatchHeaders, RoutingRuleMatchHeadersArgs
Represents a MatchHeaders condition.- Any
Of List<Pulumi.Aws Native. Api Gateway V2. Inputs. Routing Rule Match Header Value> - The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.
- Any
Of []RoutingRule Match Header Value - The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.
- any_
of list(object) - The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.
- any
Of List<RoutingRule Match Header Value> - The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.
- any
Of RoutingRule Match Header Value[] - The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.
- any_
of Sequence[RoutingRule Match Header Value] - The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.
- any
Of List<Property Map> - The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.
published on Monday, Jun 15, 2026 by Pulumi