azure logo
Azure Classic v5.43.0, May 6 23

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 test = new Azure.Network.VirtualHub("test", 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 = azurerm_virtual_hub.Example.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
		}
		_, err = network.NewVirtualHub(ctx, "test", &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: pulumi.Any(azurerm_virtual_hub.Example.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 test = new VirtualHub("test", 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(azurerm_virtual_hub.example().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)
test = azure.network.VirtualHub("test",
    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=azurerm_virtual_hub["example"]["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 test = new azure.network.VirtualHub("test", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    virtualWanId: exampleVirtualWan.id,
    addressPrefix: "10.0.1.0/24",
});
const exampleRouteMap = new azure.network.RouteMap("exampleRouteMap", {
    virtualHubId: azurerm_virtual_hub.example.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}
  test:
    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: ${azurerm_virtual_hub.example.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:

VirtualHubId string

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<RouteMapRuleArgs>

A rule block as defined below.

VirtualHubId string

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 []RouteMapRuleArgs

A rule block as defined below.

virtualHubId String

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<RouteMapRuleArgs>

A rule block as defined below.

virtualHubId string

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 RouteMapRuleArgs[]

A rule block as defined below.

virtual_hub_id str

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[RouteMapRuleArgs]

A rule block as defined below.

virtualHubId String

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.
The following state arguments are supported:
Name string

The name which should be used for this Route Map. Changing this forces a new resource to be created.

Rules List<RouteMapRuleArgs>

A rule block as defined below.

VirtualHubId string

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 []RouteMapRuleArgs

A rule block as defined below.

VirtualHubId string

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<RouteMapRuleArgs>

A rule block as defined below.

virtualHubId String

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 RouteMapRuleArgs[]

A rule block as defined below.

virtualHubId string

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[RouteMapRuleArgs]

A rule block as defined below.

virtual_hub_id str

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.

virtualHubId String

The resource ID of the Virtual Hub. Changing this forces a new resource to be created.

Supporting Types

RouteMapRule

Name string

The unique name for the rule.

Actions List<RouteMapRuleAction>

An action block as defined below.

MatchCriterions List<RouteMapRuleMatchCriterion>

A match_criterion block as defined below.

NextStepIfMatched string

The next step after the rule is evaluated. Possible values are Continue, Terminate and Unknown. Defaults to Unknown.

Name string

The unique name for the rule.

Actions []RouteMapRuleAction

An action block as defined below.

MatchCriterions []RouteMapRuleMatchCriterion

A match_criterion block as defined below.

NextStepIfMatched string

The next step after the rule is evaluated. Possible values are Continue, Terminate and Unknown. Defaults to Unknown.

name String

The unique name for the rule.

actions List<RouteMapRuleAction>

An action block as defined below.

matchCriterions List<RouteMapRuleMatchCriterion>

A match_criterion block as defined below.

nextStepIfMatched String

The next step after the rule is evaluated. Possible values are Continue, Terminate and Unknown. Defaults to Unknown.

name string

The unique name for the rule.

actions RouteMapRuleAction[]

An action block as defined below.

matchCriterions RouteMapRuleMatchCriterion[]

A match_criterion block as defined below.

nextStepIfMatched string

The next step after the rule is evaluated. Possible values are Continue, Terminate and Unknown. Defaults to Unknown.

name str

The unique name for the rule.

actions Sequence[RouteMapRuleAction]

An action block as defined below.

match_criterions Sequence[RouteMapRuleMatchCriterion]

A match_criterion block as defined below.

next_step_if_matched str

The next step after the rule is evaluated. Possible values are Continue, Terminate and Unknown. Defaults to Unknown.

name String

The unique name for the rule.

actions List<Property Map>

An action block as defined below.

matchCriterions List<Property Map>

A match_criterion block as defined below.

nextStepIfMatched String

The next step after the rule is evaluated. Possible values are Continue, Terminate and Unknown. Defaults to Unknown.

RouteMapRuleAction

Parameters List<RouteMapRuleActionParameter>

A parameter block as defined below.

Type string

The type of the action to be taken. Possible values are Add, Drop, Remove, Replace and Unknown.

Parameters []RouteMapRuleActionParameter

A parameter block as defined below.

Type string

The type of the action to be taken. Possible values are Add, Drop, Remove, Replace and Unknown.

parameters List<RouteMapRuleActionParameter>

A parameter block as defined below.

type String

The type of the action to be taken. Possible values are Add, Drop, Remove, Replace and Unknown.

parameters RouteMapRuleActionParameter[]

A parameter block as defined below.

type string

The type of the action to be taken. Possible values are Add, Drop, Remove, Replace and Unknown.

parameters Sequence[RouteMapRuleActionParameter]

A parameter block as defined below.

type str

The type of the action to be taken. Possible values are Add, Drop, Remove, Replace and Unknown.

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 and Unknown.

RouteMapRuleActionParameter

AsPaths List<string>

A list of AS paths.

Communities List<string>

A list of BGP communities.

RoutePrefixes List<string>

A list of route prefixes.

AsPaths []string

A list of AS paths.

Communities []string

A list of BGP communities.

RoutePrefixes []string

A list of route prefixes.

asPaths List<String>

A list of AS paths.

communities List<String>

A list of BGP communities.

routePrefixes List<String>

A list of route prefixes.

asPaths string[]

A list of AS paths.

communities string[]

A list of BGP communities.

routePrefixes 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.

asPaths List<String>

A list of AS paths.

communities List<String>

A list of BGP communities.

routePrefixes List<String>

A list of route prefixes.

RouteMapRuleMatchCriterion

MatchCondition string

The match condition to apply the rule of the Route Map. Possible values are Contains, Equals, NotContains, NotEquals and Unknown.

AsPaths List<string>

A list of AS paths which this criterion matches.

Communities List<string>

A list of BGP communities which this criterion matches.

RoutePrefixes List<string>

A list of route prefixes which this criterion matches.

MatchCondition string

The match condition to apply the rule of the Route Map. Possible values are Contains, Equals, NotContains, NotEquals and Unknown.

AsPaths []string

A list of AS paths which this criterion matches.

Communities []string

A list of BGP communities which this criterion matches.

RoutePrefixes []string

A list of route prefixes which this criterion matches.

matchCondition String

The match condition to apply the rule of the Route Map. Possible values are Contains, Equals, NotContains, NotEquals and Unknown.

asPaths List<String>

A list of AS paths which this criterion matches.

communities List<String>

A list of BGP communities which this criterion matches.

routePrefixes List<String>

A list of route prefixes which this criterion matches.

matchCondition string

The match condition to apply the rule of the Route Map. Possible values are Contains, Equals, NotContains, NotEquals and Unknown.

asPaths string[]

A list of AS paths which this criterion matches.

communities string[]

A list of BGP communities which this criterion matches.

routePrefixes 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 and Unknown.

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.

matchCondition String

The match condition to apply the rule of the Route Map. Possible values are Contains, Equals, NotContains, NotEquals and Unknown.

asPaths List<String>

A list of AS paths which this criterion matches.

communities List<String>

A list of BGP communities which this criterion matches.

routePrefixes 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.