We recommend using Azure Native.
azure.network.RouteMap
Explore with Pulumi AI
Manages a Route Map.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "West Europe",
});
var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new()
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
});
var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new()
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
VirtualWanId = exampleVirtualWan.Id,
AddressPrefix = "10.0.1.0/24",
});
var exampleRouteMap = new Azure.Network.RouteMap("exampleRouteMap", new()
{
VirtualHubId = exampleVirtualHub.Id,
Rules = new[]
{
new Azure.Network.Inputs.RouteMapRuleArgs
{
Name = "rule1",
NextStepIfMatched = "Continue",
Actions = new[]
{
new Azure.Network.Inputs.RouteMapRuleActionArgs
{
Type = "Add",
Parameters = new[]
{
new Azure.Network.Inputs.RouteMapRuleActionParameterArgs
{
AsPaths = new[]
{
"22334",
},
},
},
},
},
MatchCriterions = new[]
{
new Azure.Network.Inputs.RouteMapRuleMatchCriterionArgs
{
MatchCondition = "Contains",
RoutePrefixes = new[]
{
"10.0.0.0/8",
},
},
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
})
if err != nil {
return err
}
exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
VirtualWanId: exampleVirtualWan.ID(),
AddressPrefix: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
_, err = network.NewRouteMap(ctx, "exampleRouteMap", &network.RouteMapArgs{
VirtualHubId: exampleVirtualHub.ID(),
Rules: network.RouteMapRuleArray{
&network.RouteMapRuleArgs{
Name: pulumi.String("rule1"),
NextStepIfMatched: pulumi.String("Continue"),
Actions: network.RouteMapRuleActionArray{
&network.RouteMapRuleActionArgs{
Type: pulumi.String("Add"),
Parameters: network.RouteMapRuleActionParameterArray{
&network.RouteMapRuleActionParameterArgs{
AsPaths: pulumi.StringArray{
pulumi.String("22334"),
},
},
},
},
},
MatchCriterions: network.RouteMapRuleMatchCriterionArray{
&network.RouteMapRuleMatchCriterionArgs{
MatchCondition: pulumi.String("Contains"),
RoutePrefixes: pulumi.StringArray{
pulumi.String("10.0.0.0/8"),
},
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualWan;
import com.pulumi.azure.network.VirtualWanArgs;
import com.pulumi.azure.network.VirtualHub;
import com.pulumi.azure.network.VirtualHubArgs;
import com.pulumi.azure.network.RouteMap;
import com.pulumi.azure.network.RouteMapArgs;
import com.pulumi.azure.network.inputs.RouteMapRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleVirtualWan = new VirtualWan("exampleVirtualWan", VirtualWanArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.build());
var exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.virtualWanId(exampleVirtualWan.id())
.addressPrefix("10.0.1.0/24")
.build());
var exampleRouteMap = new RouteMap("exampleRouteMap", RouteMapArgs.builder()
.virtualHubId(exampleVirtualHub.id())
.rules(RouteMapRuleArgs.builder()
.name("rule1")
.nextStepIfMatched("Continue")
.actions(RouteMapRuleActionArgs.builder()
.type("Add")
.parameters(RouteMapRuleActionParameterArgs.builder()
.asPaths("22334")
.build())
.build())
.matchCriterions(RouteMapRuleMatchCriterionArgs.builder()
.matchCondition("Contains")
.routePrefixes("10.0.0.0/8")
.build())
.build())
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan",
resource_group_name=example_resource_group.name,
location=example_resource_group.location)
example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub",
resource_group_name=example_resource_group.name,
location=example_resource_group.location,
virtual_wan_id=example_virtual_wan.id,
address_prefix="10.0.1.0/24")
example_route_map = azure.network.RouteMap("exampleRouteMap",
virtual_hub_id=example_virtual_hub.id,
rules=[azure.network.RouteMapRuleArgs(
name="rule1",
next_step_if_matched="Continue",
actions=[azure.network.RouteMapRuleActionArgs(
type="Add",
parameters=[azure.network.RouteMapRuleActionParameterArgs(
as_paths=["22334"],
)],
)],
match_criterions=[azure.network.RouteMapRuleMatchCriterionArgs(
match_condition="Contains",
route_prefixes=["10.0.0.0/8"],
)],
)])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
});
const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
virtualWanId: exampleVirtualWan.id,
addressPrefix: "10.0.1.0/24",
});
const exampleRouteMap = new azure.network.RouteMap("exampleRouteMap", {
virtualHubId: exampleVirtualHub.id,
rules: [{
name: "rule1",
nextStepIfMatched: "Continue",
actions: [{
type: "Add",
parameters: [{
asPaths: ["22334"],
}],
}],
matchCriterions: [{
matchCondition: "Contains",
routePrefixes: ["10.0.0.0/8"],
}],
}],
});
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
exampleVirtualWan:
type: azure:network:VirtualWan
properties:
resourceGroupName: ${exampleResourceGroup.name}
location: ${exampleResourceGroup.location}
exampleVirtualHub:
type: azure:network:VirtualHub
properties:
resourceGroupName: ${exampleResourceGroup.name}
location: ${exampleResourceGroup.location}
virtualWanId: ${exampleVirtualWan.id}
addressPrefix: 10.0.1.0/24
exampleRouteMap:
type: azure:network:RouteMap
properties:
virtualHubId: ${exampleVirtualHub.id}
rules:
- name: rule1
nextStepIfMatched: Continue
actions:
- type: Add
parameters:
- asPaths:
- '22334'
matchCriterions:
- matchCondition: Contains
routePrefixes:
- 10.0.0.0/8
Create RouteMap Resource
new RouteMap(name: string, args: RouteMapArgs, opts?: CustomResourceOptions);
@overload
def RouteMap(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
rules: Optional[Sequence[RouteMapRuleArgs]] = None,
virtual_hub_id: Optional[str] = None)
@overload
def RouteMap(resource_name: str,
args: RouteMapArgs,
opts: Optional[ResourceOptions] = None)
func NewRouteMap(ctx *Context, name string, args RouteMapArgs, opts ...ResourceOption) (*RouteMap, error)
public RouteMap(string name, RouteMapArgs args, CustomResourceOptions? opts = null)
public RouteMap(String name, RouteMapArgs args)
public RouteMap(String name, RouteMapArgs args, CustomResourceOptions options)
type: azure:network:RouteMap
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteMapArgs
- 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 RouteMapArgs
- 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 RouteMapArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteMapArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RouteMapArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RouteMap Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The RouteMap resource accepts the following input properties:
- Virtual
Hub stringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- Name string
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- Rules
List<Route
Map Rule> A
rule
block as defined below.
- Virtual
Hub stringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- Name string
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- Rules
[]Route
Map Rule Args A
rule
block as defined below.
- virtual
Hub StringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name String
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules
List<Route
Map Rule> A
rule
block as defined below.
- virtual
Hub stringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name string
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules
Route
Map Rule[] A
rule
block as defined below.
- virtual_
hub_ strid The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name str
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules
Sequence[Route
Map Rule Args] A
rule
block as defined below.
- virtual
Hub StringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name String
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules List<Property Map>
A
rule
block as defined below.
Outputs
All input properties are implicitly available as output properties. Additionally, the RouteMap resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing RouteMap Resource
Get an existing RouteMap resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RouteMapState, opts?: CustomResourceOptions): RouteMap
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
rules: Optional[Sequence[RouteMapRuleArgs]] = None,
virtual_hub_id: Optional[str] = None) -> RouteMap
func GetRouteMap(ctx *Context, name string, id IDInput, state *RouteMapState, opts ...ResourceOption) (*RouteMap, error)
public static RouteMap Get(string name, Input<string> id, RouteMapState? state, CustomResourceOptions? opts = null)
public static RouteMap get(String name, Output<String> id, RouteMapState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Name string
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- Rules
List<Route
Map Rule> A
rule
block as defined below.- Virtual
Hub stringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- Name string
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- Rules
[]Route
Map Rule Args A
rule
block as defined below.- Virtual
Hub stringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name String
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules
List<Route
Map Rule> A
rule
block as defined below.- virtual
Hub StringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name string
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules
Route
Map Rule[] A
rule
block as defined below.- virtual
Hub stringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name str
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules
Sequence[Route
Map Rule Args] A
rule
block as defined below.- virtual_
hub_ strid The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
- name String
The name which should be used for this Route Map. Changing this forces a new resource to be created.
- rules List<Property Map>
A
rule
block as defined below.- virtual
Hub StringId The resource ID of the Virtual Hub. Changing this forces a new resource to be created.
Supporting Types
RouteMapRule, RouteMapRuleArgs
- Name string
The unique name for the rule.
- Actions
List<Route
Map Rule Action> An
action
block as defined below.- Match
Criterions List<RouteMap Rule Match Criterion> A
match_criterion
block as defined below.- Next
Step stringIf Matched The next step after the rule is evaluated. Possible values are
Continue
,Terminate
andUnknown
. Defaults toUnknown
.
- Name string
The unique name for the rule.
- Actions
[]Route
Map Rule Action An
action
block as defined below.- Match
Criterions []RouteMap Rule Match Criterion A
match_criterion
block as defined below.- Next
Step stringIf Matched The next step after the rule is evaluated. Possible values are
Continue
,Terminate
andUnknown
. Defaults toUnknown
.
- name String
The unique name for the rule.
- actions
List<Route
Map Rule Action> An
action
block as defined below.- match
Criterions List<RouteMap Rule Match Criterion> A
match_criterion
block as defined below.- next
Step StringIf Matched The next step after the rule is evaluated. Possible values are
Continue
,Terminate
andUnknown
. Defaults toUnknown
.
- name string
The unique name for the rule.
- actions
Route
Map Rule Action[] An
action
block as defined below.- match
Criterions RouteMap Rule Match Criterion[] A
match_criterion
block as defined below.- next
Step stringIf Matched The next step after the rule is evaluated. Possible values are
Continue
,Terminate
andUnknown
. Defaults toUnknown
.
- name str
The unique name for the rule.
- actions
Sequence[Route
Map Rule Action] An
action
block as defined below.- match_
criterions Sequence[RouteMap Rule Match Criterion] A
match_criterion
block as defined below.- next_
step_ strif_ matched The next step after the rule is evaluated. Possible values are
Continue
,Terminate
andUnknown
. Defaults toUnknown
.
- name String
The unique name for the rule.
- actions List<Property Map>
An
action
block as defined below.- match
Criterions List<Property Map> A
match_criterion
block as defined below.- next
Step StringIf Matched The next step after the rule is evaluated. Possible values are
Continue
,Terminate
andUnknown
. Defaults toUnknown
.
RouteMapRuleAction, RouteMapRuleActionArgs
- Parameters
List<Route
Map Rule Action Parameter> A
parameter
block as defined below.- Type string
The type of the action to be taken. Possible values are
Add
,Drop
,Remove
,Replace
andUnknown
.
- Parameters
[]Route
Map Rule Action Parameter A
parameter
block as defined below.- Type string
The type of the action to be taken. Possible values are
Add
,Drop
,Remove
,Replace
andUnknown
.
- parameters
List<Route
Map Rule Action Parameter> A
parameter
block as defined below.- type String
The type of the action to be taken. Possible values are
Add
,Drop
,Remove
,Replace
andUnknown
.
- parameters
Route
Map Rule Action Parameter[] A
parameter
block as defined below.- type string
The type of the action to be taken. Possible values are
Add
,Drop
,Remove
,Replace
andUnknown
.
- parameters
Sequence[Route
Map Rule Action Parameter] A
parameter
block as defined below.- type str
The type of the action to be taken. Possible values are
Add
,Drop
,Remove
,Replace
andUnknown
.
- parameters List<Property Map>
A
parameter
block as defined below.- type String
The type of the action to be taken. Possible values are
Add
,Drop
,Remove
,Replace
andUnknown
.
RouteMapRuleActionParameter, RouteMapRuleActionParameterArgs
- As
Paths List<string> A list of AS paths.
- Communities List<string>
A list of BGP communities.
- Route
Prefixes List<string> A list of route prefixes.
- As
Paths []string A list of AS paths.
- Communities []string
A list of BGP communities.
- Route
Prefixes []string A list of route prefixes.
- as
Paths List<String> A list of AS paths.
- communities List<String>
A list of BGP communities.
- route
Prefixes List<String> A list of route prefixes.
- as
Paths string[] A list of AS paths.
- communities string[]
A list of BGP communities.
- route
Prefixes string[] A list of route prefixes.
- as_
paths Sequence[str] A list of AS paths.
- communities Sequence[str]
A list of BGP communities.
- route_
prefixes Sequence[str] A list of route prefixes.
- as
Paths List<String> A list of AS paths.
- communities List<String>
A list of BGP communities.
- route
Prefixes List<String> A list of route prefixes.
RouteMapRuleMatchCriterion, RouteMapRuleMatchCriterionArgs
- Match
Condition string The match condition to apply the rule of the Route Map. Possible values are
Contains
,Equals
,NotContains
,NotEquals
andUnknown
.- As
Paths List<string> A list of AS paths which this criterion matches.
- Communities List<string>
A list of BGP communities which this criterion matches.
- Route
Prefixes List<string> A list of route prefixes which this criterion matches.
- Match
Condition string The match condition to apply the rule of the Route Map. Possible values are
Contains
,Equals
,NotContains
,NotEquals
andUnknown
.- As
Paths []string A list of AS paths which this criterion matches.
- Communities []string
A list of BGP communities which this criterion matches.
- Route
Prefixes []string A list of route prefixes which this criterion matches.
- match
Condition String The match condition to apply the rule of the Route Map. Possible values are
Contains
,Equals
,NotContains
,NotEquals
andUnknown
.- as
Paths List<String> A list of AS paths which this criterion matches.
- communities List<String>
A list of BGP communities which this criterion matches.
- route
Prefixes List<String> A list of route prefixes which this criterion matches.
- match
Condition string The match condition to apply the rule of the Route Map. Possible values are
Contains
,Equals
,NotContains
,NotEquals
andUnknown
.- as
Paths string[] A list of AS paths which this criterion matches.
- communities string[]
A list of BGP communities which this criterion matches.
- route
Prefixes string[] A list of route prefixes which this criterion matches.
- match_
condition str The match condition to apply the rule of the Route Map. Possible values are
Contains
,Equals
,NotContains
,NotEquals
andUnknown
.- as_
paths Sequence[str] A list of AS paths which this criterion matches.
- communities Sequence[str]
A list of BGP communities which this criterion matches.
- route_
prefixes Sequence[str] A list of route prefixes which this criterion matches.
- match
Condition String The match condition to apply the rule of the Route Map. Possible values are
Contains
,Equals
,NotContains
,NotEquals
andUnknown
.- as
Paths List<String> A list of AS paths which this criterion matches.
- communities List<String>
A list of BGP communities which this criterion matches.
- route
Prefixes List<String> A list of route prefixes which this criterion matches.
Import
Route Maps can be imported using the resource id
, e.g.
$ pulumi import azure:network/routeMap:RouteMap example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.