azure-native.network.RoutingRule
Explore with Pulumi AI
Network routing rule.
Uses Azure REST API version 2024-03-01.
Other available API versions: 2024-05-01.
Example Usage
Create a default routing rule
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() => 
{
    var routingRule = new AzureNative.Network.RoutingRule("routingRule", new()
    {
        ConfigurationName = "myTestRoutingConfig",
        Description = "This is Sample Routing Rule",
        Destination = new AzureNative.Network.Inputs.RoutingRuleRouteDestinationArgs
        {
            DestinationAddress = "10.0.0.0/16",
            Type = AzureNative.Network.RoutingRuleDestinationType.AddressPrefix,
        },
        NetworkManagerName = "testNetworkManager",
        NextHop = new AzureNative.Network.Inputs.RoutingRuleNextHopArgs
        {
            NextHopType = AzureNative.Network.RoutingRuleNextHopType.VirtualNetworkGateway,
        },
        ResourceGroupName = "rg1",
        RuleCollectionName = "testRuleCollection",
        RuleName = "SampleRoutingRule",
    });
});
package main
import (
	network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewRoutingRule(ctx, "routingRule", &network.RoutingRuleArgs{
			ConfigurationName: pulumi.String("myTestRoutingConfig"),
			Description:       pulumi.String("This is Sample Routing Rule"),
			Destination: &network.RoutingRuleRouteDestinationArgs{
				DestinationAddress: pulumi.String("10.0.0.0/16"),
				Type:               pulumi.String(network.RoutingRuleDestinationTypeAddressPrefix),
			},
			NetworkManagerName: pulumi.String("testNetworkManager"),
			NextHop: &network.RoutingRuleNextHopArgs{
				NextHopType: pulumi.String(network.RoutingRuleNextHopTypeVirtualNetworkGateway),
			},
			ResourceGroupName:  pulumi.String("rg1"),
			RuleCollectionName: pulumi.String("testRuleCollection"),
			RuleName:           pulumi.String("SampleRoutingRule"),
		})
		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.azurenative.network.RoutingRule;
import com.pulumi.azurenative.network.RoutingRuleArgs;
import com.pulumi.azurenative.network.inputs.RoutingRuleRouteDestinationArgs;
import com.pulumi.azurenative.network.inputs.RoutingRuleNextHopArgs;
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 routingRule = new RoutingRule("routingRule", RoutingRuleArgs.builder()
            .configurationName("myTestRoutingConfig")
            .description("This is Sample Routing Rule")
            .destination(RoutingRuleRouteDestinationArgs.builder()
                .destinationAddress("10.0.0.0/16")
                .type("AddressPrefix")
                .build())
            .networkManagerName("testNetworkManager")
            .nextHop(RoutingRuleNextHopArgs.builder()
                .nextHopType("VirtualNetworkGateway")
                .build())
            .resourceGroupName("rg1")
            .ruleCollectionName("testRuleCollection")
            .ruleName("SampleRoutingRule")
            .build());
    }
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const routingRule = new azure_native.network.RoutingRule("routingRule", {
    configurationName: "myTestRoutingConfig",
    description: "This is Sample Routing Rule",
    destination: {
        destinationAddress: "10.0.0.0/16",
        type: azure_native.network.RoutingRuleDestinationType.AddressPrefix,
    },
    networkManagerName: "testNetworkManager",
    nextHop: {
        nextHopType: azure_native.network.RoutingRuleNextHopType.VirtualNetworkGateway,
    },
    resourceGroupName: "rg1",
    ruleCollectionName: "testRuleCollection",
    ruleName: "SampleRoutingRule",
});
import pulumi
import pulumi_azure_native as azure_native
routing_rule = azure_native.network.RoutingRule("routingRule",
    configuration_name="myTestRoutingConfig",
    description="This is Sample Routing Rule",
    destination={
        "destination_address": "10.0.0.0/16",
        "type": azure_native.network.RoutingRuleDestinationType.ADDRESS_PREFIX,
    },
    network_manager_name="testNetworkManager",
    next_hop={
        "next_hop_type": azure_native.network.RoutingRuleNextHopType.VIRTUAL_NETWORK_GATEWAY,
    },
    resource_group_name="rg1",
    rule_collection_name="testRuleCollection",
    rule_name="SampleRoutingRule")
resources:
  routingRule:
    type: azure-native:network:RoutingRule
    properties:
      configurationName: myTestRoutingConfig
      description: This is Sample Routing Rule
      destination:
        destinationAddress: 10.0.0.0/16
        type: AddressPrefix
      networkManagerName: testNetworkManager
      nextHop:
        nextHopType: VirtualNetworkGateway
      resourceGroupName: rg1
      ruleCollectionName: testRuleCollection
      ruleName: SampleRoutingRule
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: RoutingRuleInitArgs,
                opts: Optional[ResourceOptions] = None)
@overload
def RoutingRule(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                configuration_name: Optional[str] = None,
                destination: Optional[RoutingRuleRouteDestinationArgs] = None,
                network_manager_name: Optional[str] = None,
                next_hop: Optional[RoutingRuleNextHopArgs] = None,
                resource_group_name: Optional[str] = None,
                rule_collection_name: Optional[str] = None,
                description: Optional[str] = None,
                rule_name: Optional[str] = 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: azure-native:network:RoutingRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
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 RoutingRuleInitArgs
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var routingRuleResource = new AzureNative.Network.RoutingRule("routingRuleResource", new()
{
    ConfigurationName = "string",
    Destination = new AzureNative.Network.Inputs.RoutingRuleRouteDestinationArgs
    {
        DestinationAddress = "string",
        Type = "string",
    },
    NetworkManagerName = "string",
    NextHop = new AzureNative.Network.Inputs.RoutingRuleNextHopArgs
    {
        NextHopType = "string",
        NextHopAddress = "string",
    },
    ResourceGroupName = "string",
    RuleCollectionName = "string",
    Description = "string",
    RuleName = "string",
});
example, err := network.NewRoutingRule(ctx, "routingRuleResource", &network.RoutingRuleArgs{
	ConfigurationName: pulumi.String("string"),
	Destination: &network.RoutingRuleRouteDestinationArgs{
		DestinationAddress: pulumi.String("string"),
		Type:               pulumi.String("string"),
	},
	NetworkManagerName: pulumi.String("string"),
	NextHop: &network.RoutingRuleNextHopArgs{
		NextHopType:    pulumi.String("string"),
		NextHopAddress: pulumi.String("string"),
	},
	ResourceGroupName:  pulumi.String("string"),
	RuleCollectionName: pulumi.String("string"),
	Description:        pulumi.String("string"),
	RuleName:           pulumi.String("string"),
})
var routingRuleResource = new RoutingRule("routingRuleResource", RoutingRuleArgs.builder()
    .configurationName("string")
    .destination(RoutingRuleRouteDestinationArgs.builder()
        .destinationAddress("string")
        .type("string")
        .build())
    .networkManagerName("string")
    .nextHop(RoutingRuleNextHopArgs.builder()
        .nextHopType("string")
        .nextHopAddress("string")
        .build())
    .resourceGroupName("string")
    .ruleCollectionName("string")
    .description("string")
    .ruleName("string")
    .build());
routing_rule_resource = azure_native.network.RoutingRule("routingRuleResource",
    configuration_name="string",
    destination={
        "destination_address": "string",
        "type": "string",
    },
    network_manager_name="string",
    next_hop={
        "next_hop_type": "string",
        "next_hop_address": "string",
    },
    resource_group_name="string",
    rule_collection_name="string",
    description="string",
    rule_name="string")
const routingRuleResource = new azure_native.network.RoutingRule("routingRuleResource", {
    configurationName: "string",
    destination: {
        destinationAddress: "string",
        type: "string",
    },
    networkManagerName: "string",
    nextHop: {
        nextHopType: "string",
        nextHopAddress: "string",
    },
    resourceGroupName: "string",
    ruleCollectionName: "string",
    description: "string",
    ruleName: "string",
});
type: azure-native:network:RoutingRule
properties:
    configurationName: string
    description: string
    destination:
        destinationAddress: string
        type: string
    networkManagerName: string
    nextHop:
        nextHopAddress: string
        nextHopType: string
    resourceGroupName: string
    ruleCollectionName: string
    ruleName: string
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:
- ConfigurationName string
- The name of the network manager Routing Configuration.
- Destination
Pulumi.Azure Native. Network. Inputs. Routing Rule Route Destination 
- Indicates the destination for this particular rule.
- NetworkManager stringName 
- The name of the network manager.
- NextHop Pulumi.Azure Native. Network. Inputs. Routing Rule Next Hop 
- Indicates the next hop for this particular rule.
- ResourceGroup stringName 
- The name of the resource group. The name is case insensitive.
- RuleCollection stringName 
- The name of the network manager routing Configuration rule collection.
- Description string
- A description for this rule.
- RuleName string
- The name of the rule.
- ConfigurationName string
- The name of the network manager Routing Configuration.
- Destination
RoutingRule Route Destination Args 
- Indicates the destination for this particular rule.
- NetworkManager stringName 
- The name of the network manager.
- NextHop RoutingRule Next Hop Args 
- Indicates the next hop for this particular rule.
- ResourceGroup stringName 
- The name of the resource group. The name is case insensitive.
- RuleCollection stringName 
- The name of the network manager routing Configuration rule collection.
- Description string
- A description for this rule.
- RuleName string
- The name of the rule.
- configurationName String
- The name of the network manager Routing Configuration.
- destination
RoutingRule Route Destination 
- Indicates the destination for this particular rule.
- networkManager StringName 
- The name of the network manager.
- nextHop RoutingRule Next Hop 
- Indicates the next hop for this particular rule.
- resourceGroup StringName 
- The name of the resource group. The name is case insensitive.
- ruleCollection StringName 
- The name of the network manager routing Configuration rule collection.
- description String
- A description for this rule.
- ruleName String
- The name of the rule.
- configurationName string
- The name of the network manager Routing Configuration.
- destination
RoutingRule Route Destination 
- Indicates the destination for this particular rule.
- networkManager stringName 
- The name of the network manager.
- nextHop RoutingRule Next Hop 
- Indicates the next hop for this particular rule.
- resourceGroup stringName 
- The name of the resource group. The name is case insensitive.
- ruleCollection stringName 
- The name of the network manager routing Configuration rule collection.
- description string
- A description for this rule.
- ruleName string
- The name of the rule.
- configuration_name str
- The name of the network manager Routing Configuration.
- destination
RoutingRule Route Destination Args 
- Indicates the destination for this particular rule.
- network_manager_ strname 
- The name of the network manager.
- next_hop RoutingRule Next Hop Args 
- Indicates the next hop for this particular rule.
- resource_group_ strname 
- The name of the resource group. The name is case insensitive.
- rule_collection_ strname 
- The name of the network manager routing Configuration rule collection.
- description str
- A description for this rule.
- rule_name str
- The name of the rule.
- configurationName String
- The name of the network manager Routing Configuration.
- destination Property Map
- Indicates the destination for this particular rule.
- networkManager StringName 
- The name of the network manager.
- nextHop Property Map
- Indicates the next hop for this particular rule.
- resourceGroup StringName 
- The name of the resource group. The name is case insensitive.
- ruleCollection StringName 
- The name of the network manager routing Configuration rule collection.
- description String
- A description for this rule.
- ruleName String
- The name of the rule.
Outputs
All input properties are implicitly available as output properties. Additionally, the RoutingRule resource produces the following output properties:
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name.
- ProvisioningState string
- The provisioning state of the resource.
- ResourceGuid string
- Unique identifier for this resource.
- SystemData Pulumi.Azure Native. Network. Outputs. System Data Response 
- The system metadata related to this resource.
- Type string
- Resource type.
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name.
- ProvisioningState string
- The provisioning state of the resource.
- ResourceGuid string
- Unique identifier for this resource.
- SystemData SystemData Response 
- The system metadata related to this resource.
- Type string
- Resource type.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name.
- provisioningState String
- The provisioning state of the resource.
- resourceGuid String
- Unique identifier for this resource.
- systemData SystemData Response 
- The system metadata related to this resource.
- type String
- Resource type.
- etag string
- A unique read-only string that changes whenever the resource is updated.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Resource name.
- provisioningState string
- The provisioning state of the resource.
- resourceGuid string
- Unique identifier for this resource.
- systemData SystemData Response 
- The system metadata related to this resource.
- type string
- Resource type.
- etag str
- A unique read-only string that changes whenever the resource is updated.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Resource name.
- provisioning_state str
- The provisioning state of the resource.
- resource_guid str
- Unique identifier for this resource.
- system_data SystemData Response 
- The system metadata related to this resource.
- type str
- Resource type.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name.
- provisioningState String
- The provisioning state of the resource.
- resourceGuid String
- Unique identifier for this resource.
- systemData Property Map
- The system metadata related to this resource.
- type String
- Resource type.
Supporting Types
RoutingRuleDestinationType, RoutingRuleDestinationTypeArgs        
- AddressPrefix 
- AddressPrefix
- ServiceTag 
- ServiceTag
- RoutingRule Destination Type Address Prefix 
- AddressPrefix
- RoutingRule Destination Type Service Tag 
- ServiceTag
- AddressPrefix 
- AddressPrefix
- ServiceTag 
- ServiceTag
- AddressPrefix 
- AddressPrefix
- ServiceTag 
- ServiceTag
- ADDRESS_PREFIX
- AddressPrefix
- SERVICE_TAG
- ServiceTag
- "AddressPrefix" 
- AddressPrefix
- "ServiceTag" 
- ServiceTag
RoutingRuleNextHop, RoutingRuleNextHopArgs        
- NextHop string | Pulumi.Type Azure Native. Network. Routing Rule Next Hop Type 
- Next hop type.
- NextHop stringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- NextHop string | RoutingType Rule Next Hop Type 
- Next hop type.
- NextHop stringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- nextHop String | RoutingType Rule Next Hop Type 
- Next hop type.
- nextHop StringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- nextHop string | RoutingType Rule Next Hop Type 
- Next hop type.
- nextHop stringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- next_hop_ str | Routingtype Rule Next Hop Type 
- Next hop type.
- next_hop_ straddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- nextHop String | "Internet" | "NoType Next Hop" | "Virtual Appliance" | "Virtual Network Gateway" | "Vnet Local" 
- Next hop type.
- nextHop StringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
RoutingRuleNextHopResponse, RoutingRuleNextHopResponseArgs          
- NextHop stringType 
- Next hop type.
- NextHop stringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- NextHop stringType 
- Next hop type.
- NextHop stringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- nextHop StringType 
- Next hop type.
- nextHop StringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- nextHop stringType 
- Next hop type.
- nextHop stringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- next_hop_ strtype 
- Next hop type.
- next_hop_ straddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
- nextHop StringType 
- Next hop type.
- nextHop StringAddress 
- Next hop address. Only required if the next hop type is VirtualAppliance.
RoutingRuleNextHopType, RoutingRuleNextHopTypeArgs          
- Internet
- Internet
- NoNext Hop 
- NoNextHop
- VirtualAppliance 
- VirtualAppliance
- VirtualNetwork Gateway 
- VirtualNetworkGateway
- VnetLocal 
- VnetLocal
- RoutingRule Next Hop Type Internet 
- Internet
- RoutingRule Next Hop Type No Next Hop 
- NoNextHop
- RoutingRule Next Hop Type Virtual Appliance 
- VirtualAppliance
- RoutingRule Next Hop Type Virtual Network Gateway 
- VirtualNetworkGateway
- RoutingRule Next Hop Type Vnet Local 
- VnetLocal
- Internet
- Internet
- NoNext Hop 
- NoNextHop
- VirtualAppliance 
- VirtualAppliance
- VirtualNetwork Gateway 
- VirtualNetworkGateway
- VnetLocal 
- VnetLocal
- Internet
- Internet
- NoNext Hop 
- NoNextHop
- VirtualAppliance 
- VirtualAppliance
- VirtualNetwork Gateway 
- VirtualNetworkGateway
- VnetLocal 
- VnetLocal
- INTERNET
- Internet
- NO_NEXT_HOP
- NoNextHop
- VIRTUAL_APPLIANCE
- VirtualAppliance
- VIRTUAL_NETWORK_GATEWAY
- VirtualNetworkGateway
- VNET_LOCAL
- VnetLocal
- "Internet"
- Internet
- "NoNext Hop" 
- NoNextHop
- "VirtualAppliance" 
- VirtualAppliance
- "VirtualNetwork Gateway" 
- VirtualNetworkGateway
- "VnetLocal" 
- VnetLocal
RoutingRuleRouteDestination, RoutingRuleRouteDestinationArgs        
- DestinationAddress string
- Destination address.
- Type
string | Pulumi.Azure Native. Network. Routing Rule Destination Type 
- Destination type.
- DestinationAddress string
- Destination address.
- Type
string | RoutingRule Destination Type 
- Destination type.
- destinationAddress String
- Destination address.
- type
String | RoutingRule Destination Type 
- Destination type.
- destinationAddress string
- Destination address.
- type
string | RoutingRule Destination Type 
- Destination type.
- destination_address str
- Destination address.
- type
str | RoutingRule Destination Type 
- Destination type.
- destinationAddress String
- Destination address.
- type
String | "AddressPrefix" | "Service Tag" 
- Destination type.
RoutingRuleRouteDestinationResponse, RoutingRuleRouteDestinationResponseArgs          
- DestinationAddress string
- Destination address.
- Type string
- Destination type.
- DestinationAddress string
- Destination address.
- Type string
- Destination type.
- destinationAddress String
- Destination address.
- type String
- Destination type.
- destinationAddress string
- Destination address.
- type string
- Destination type.
- destination_address str
- Destination address.
- type str
- Destination type.
- destinationAddress String
- Destination address.
- type String
- Destination type.
SystemDataResponse, SystemDataResponseArgs      
- CreatedAt string
- The timestamp of resource creation (UTC).
- CreatedBy string
- The identity that created the resource.
- CreatedBy stringType 
- The type of identity that created the resource.
- LastModified stringAt 
- The type of identity that last modified the resource.
- LastModified stringBy 
- The identity that last modified the resource.
- LastModified stringBy Type 
- The type of identity that last modified the resource.
- CreatedAt string
- The timestamp of resource creation (UTC).
- CreatedBy string
- The identity that created the resource.
- CreatedBy stringType 
- The type of identity that created the resource.
- LastModified stringAt 
- The type of identity that last modified the resource.
- LastModified stringBy 
- The identity that last modified the resource.
- LastModified stringBy Type 
- The type of identity that last modified the resource.
- createdAt String
- The timestamp of resource creation (UTC).
- createdBy String
- The identity that created the resource.
- createdBy StringType 
- The type of identity that created the resource.
- lastModified StringAt 
- The type of identity that last modified the resource.
- lastModified StringBy 
- The identity that last modified the resource.
- lastModified StringBy Type 
- The type of identity that last modified the resource.
- createdAt string
- The timestamp of resource creation (UTC).
- createdBy string
- The identity that created the resource.
- createdBy stringType 
- The type of identity that created the resource.
- lastModified stringAt 
- The type of identity that last modified the resource.
- lastModified stringBy 
- The identity that last modified the resource.
- lastModified stringBy Type 
- The type of identity that last modified the resource.
- created_at str
- The timestamp of resource creation (UTC).
- created_by str
- The identity that created the resource.
- created_by_ strtype 
- The type of identity that created the resource.
- last_modified_ strat 
- The type of identity that last modified the resource.
- last_modified_ strby 
- The identity that last modified the resource.
- last_modified_ strby_ type 
- The type of identity that last modified the resource.
- createdAt String
- The timestamp of resource creation (UTC).
- createdBy String
- The identity that created the resource.
- createdBy StringType 
- The type of identity that created the resource.
- lastModified StringAt 
- The type of identity that last modified the resource.
- lastModified StringBy 
- The identity that last modified the resource.
- lastModified StringBy Type 
- The type of identity that last modified the resource.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:RoutingRule SampleRoutingRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName} 
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0