Modifier

Partager via


New-AzRouteMapRule

Create a route map rule.

Syntax

New-AzRouteMapRule
   [-MatchCriteria <PSRouteMapRuleCriterion[]>]
   -RouteMapRuleAction <PSRouteMapRuleAction[]>
   -NextStepIfMatched <String>
   -Name <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create a route map rule.

Examples

Example 1

# creating new route map rules and a new route map resource
$routeMapMatchCriterion1 = New-AzRouteMapRuleCriterion -MatchCondition "Contains" -RoutePrefix @("10.0.0.0/16")
$routeMapRuleActionParameter1 = New-AzRouteMapRuleActionParameter -AsPath @("12345")
$routeMapRuleAction1 = New-AzRouteMapRuleAction -Type "Add" -Parameter @($routeMapRuleActionParameter1)
New-AzRouteMapRule -Name "rule1" -MatchCriteria @($routeMapMatchCriterion1) -RouteMapRuleAction @($routeMapRuleAction1) -NextStepIfMatched "Continue"

MatchCriteria     : {}
Actions           : {}
NextStepIfMatched : Continue
MatchCriteriaText : [
                      {
                        "MatchCondition": "Contains",
                        "RoutePrefix": [
                          "10.0.0.0/16"
                        ]
                      }
                    ]
ActionsText       : [
                      {
                        "Type": "Add",
                        "Parameters": [
                          {
                            "AsPath": [
                              "12345"
                            ]
                          }
                        ]
                      }
                    ]
Name              : rule1
Etag              :
Id                :

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MatchCriteria

The route map rule Match Criteria. If not providing, will match all

Type:PSRouteMapRuleCriterion[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The route map rule name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NextStepIfMatched

Next step if the route map rule matched.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RouteMapRuleAction

The route map rule actions.

Type:PSRouteMapRuleAction[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSRouteMapRuleCriterion

PSRouteMapRuleAction

String

Outputs

PSRouteMapRule