1. Packages
  2. Azure Native
  3. API Docs
  4. network
  5. Route
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v2.82.0 published on Friday, Jan 10, 2025 by Pulumi

azure-native.network.Route

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v2.82.0 published on Friday, Jan 10, 2025 by Pulumi

Route resource. Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-11-01.

Other available API versions: 2019-06-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01, 2024-05-01.

Example Usage

Create route

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var route = new AzureNative.Network.Route("route", new()
    {
        AddressPrefix = "10.0.3.0/24",
        NextHopType = AzureNative.Network.RouteNextHopType.VirtualNetworkGateway,
        ResourceGroupName = "rg1",
        RouteName = "route1",
        RouteTableName = "testrt",
    });

});
Copy
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.NewRoute(ctx, "route", &network.RouteArgs{
			AddressPrefix:     pulumi.String("10.0.3.0/24"),
			NextHopType:       pulumi.String(network.RouteNextHopTypeVirtualNetworkGateway),
			ResourceGroupName: pulumi.String("rg1"),
			RouteName:         pulumi.String("route1"),
			RouteTableName:    pulumi.String("testrt"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.Route;
import com.pulumi.azurenative.network.RouteArgs;
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 route = new Route("route", RouteArgs.builder()
            .addressPrefix("10.0.3.0/24")
            .nextHopType("VirtualNetworkGateway")
            .resourceGroupName("rg1")
            .routeName("route1")
            .routeTableName("testrt")
            .build());

    }
}
Copy
import pulumi
import pulumi_azure_native as azure_native

route = azure_native.network.Route("route",
    address_prefix="10.0.3.0/24",
    next_hop_type=azure_native.network.RouteNextHopType.VIRTUAL_NETWORK_GATEWAY,
    resource_group_name="rg1",
    route_name="route1",
    route_table_name="testrt")
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const route = new azure_native.network.Route("route", {
    addressPrefix: "10.0.3.0/24",
    nextHopType: azure_native.network.RouteNextHopType.VirtualNetworkGateway,
    resourceGroupName: "rg1",
    routeName: "route1",
    routeTableName: "testrt",
});
Copy
resources:
  route:
    type: azure-native:network:Route
    properties:
      addressPrefix: 10.0.3.0/24
      nextHopType: VirtualNetworkGateway
      resourceGroupName: rg1
      routeName: route1
      routeTableName: testrt
Copy

Create Route Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
@overload
def Route(resource_name: str,
          args: RouteInitArgs,
          opts: Optional[ResourceOptions] = None)

@overload
def Route(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          next_hop_type: Optional[Union[str, RouteNextHopType]] = None,
          resource_group_name: Optional[str] = None,
          route_table_name: Optional[str] = None,
          address_prefix: Optional[str] = None,
          id: Optional[str] = None,
          name: Optional[str] = None,
          next_hop_ip_address: Optional[str] = None,
          route_name: Optional[str] = None,
          type: Optional[str] = None)
func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)
public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)
public Route(String name, RouteArgs args)
public Route(String name, RouteArgs args, CustomResourceOptions options)
type: azure-native:network:Route
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RouteInitArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RouteArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RouteArgs
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 azure_nativeRouteResource = new AzureNative.Network.Route("azure-nativeRouteResource", new()
{
    NextHopType = "string",
    ResourceGroupName = "string",
    RouteTableName = "string",
    AddressPrefix = "string",
    Id = "string",
    Name = "string",
    NextHopIpAddress = "string",
    RouteName = "string",
    Type = "string",
});
Copy
example, err := network.NewRoute(ctx, "azure-nativeRouteResource", &network.RouteArgs{
	NextHopType:       pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	RouteTableName:    pulumi.String("string"),
	AddressPrefix:     pulumi.String("string"),
	Id:                pulumi.String("string"),
	Name:              pulumi.String("string"),
	NextHopIpAddress:  pulumi.String("string"),
	RouteName:         pulumi.String("string"),
	Type:              pulumi.String("string"),
})
Copy
var azure_nativeRouteResource = new Route("azure-nativeRouteResource", RouteArgs.builder()
    .nextHopType("string")
    .resourceGroupName("string")
    .routeTableName("string")
    .addressPrefix("string")
    .id("string")
    .name("string")
    .nextHopIpAddress("string")
    .routeName("string")
    .type("string")
    .build());
Copy
azure_native_route_resource = azure_native.network.Route("azure-nativeRouteResource",
    next_hop_type="string",
    resource_group_name="string",
    route_table_name="string",
    address_prefix="string",
    id="string",
    name="string",
    next_hop_ip_address="string",
    route_name="string",
    type="string")
Copy
const azure_nativeRouteResource = new azure_native.network.Route("azure-nativeRouteResource", {
    nextHopType: "string",
    resourceGroupName: "string",
    routeTableName: "string",
    addressPrefix: "string",
    id: "string",
    name: "string",
    nextHopIpAddress: "string",
    routeName: "string",
    type: "string",
});
Copy
type: azure-native:network:Route
properties:
    addressPrefix: string
    id: string
    name: string
    nextHopIpAddress: string
    nextHopType: string
    resourceGroupName: string
    routeName: string
    routeTableName: string
    type: string
Copy

Route 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 Route resource accepts the following input properties:

NextHopType This property is required. string | Pulumi.AzureNative.Network.RouteNextHopType
The type of Azure hop the packet should be sent to.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
RouteTableName
This property is required.
Changes to this property will trigger replacement.
string
The name of the route table.
AddressPrefix string
The destination CIDR to which the route applies.
Id string
Resource ID.
Name string
The name of the resource that is unique within a resource group. This name can be used to access the resource.
NextHopIpAddress string
The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
RouteName Changes to this property will trigger replacement. string
The name of the route.
Type string
The type of the resource.
NextHopType This property is required. string | RouteNextHopType
The type of Azure hop the packet should be sent to.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
RouteTableName
This property is required.
Changes to this property will trigger replacement.
string
The name of the route table.
AddressPrefix string
The destination CIDR to which the route applies.
Id string
Resource ID.
Name string
The name of the resource that is unique within a resource group. This name can be used to access the resource.
NextHopIpAddress string
The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
RouteName Changes to this property will trigger replacement. string
The name of the route.
Type string
The type of the resource.
nextHopType This property is required. String | RouteNextHopType
The type of Azure hop the packet should be sent to.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
routeTableName
This property is required.
Changes to this property will trigger replacement.
String
The name of the route table.
addressPrefix String
The destination CIDR to which the route applies.
id String
Resource ID.
name String
The name of the resource that is unique within a resource group. This name can be used to access the resource.
nextHopIpAddress String
The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
routeName Changes to this property will trigger replacement. String
The name of the route.
type String
The type of the resource.
nextHopType This property is required. string | RouteNextHopType
The type of Azure hop the packet should be sent to.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
routeTableName
This property is required.
Changes to this property will trigger replacement.
string
The name of the route table.
addressPrefix string
The destination CIDR to which the route applies.
id string
Resource ID.
name string
The name of the resource that is unique within a resource group. This name can be used to access the resource.
nextHopIpAddress string
The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
routeName Changes to this property will trigger replacement. string
The name of the route.
type string
The type of the resource.
next_hop_type This property is required. str | RouteNextHopType
The type of Azure hop the packet should be sent to.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
route_table_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the route table.
address_prefix str
The destination CIDR to which the route applies.
id str
Resource ID.
name str
The name of the resource that is unique within a resource group. This name can be used to access the resource.
next_hop_ip_address str
The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
route_name Changes to this property will trigger replacement. str
The name of the route.
type str
The type of the resource.
nextHopType This property is required. String | "VirtualNetworkGateway" | "VnetLocal" | "Internet" | "VirtualAppliance" | "None"
The type of Azure hop the packet should be sent to.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
routeTableName
This property is required.
Changes to this property will trigger replacement.
String
The name of the route table.
addressPrefix String
The destination CIDR to which the route applies.
id String
Resource ID.
name String
The name of the resource that is unique within a resource group. This name can be used to access the resource.
nextHopIpAddress String
The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
routeName Changes to this property will trigger replacement. String
The name of the route.
type String
The type of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:

Etag string
A unique read-only string that changes whenever the resource is updated.
HasBgpOverride bool
A value indicating whether this route overrides overlapping BGP routes regardless of LPM.
Id string
The provider-assigned unique ID for this managed resource.
ProvisioningState string
The provisioning state of the route resource.
Etag string
A unique read-only string that changes whenever the resource is updated.
HasBgpOverride bool
A value indicating whether this route overrides overlapping BGP routes regardless of LPM.
Id string
The provider-assigned unique ID for this managed resource.
ProvisioningState string
The provisioning state of the route resource.
etag String
A unique read-only string that changes whenever the resource is updated.
hasBgpOverride Boolean
A value indicating whether this route overrides overlapping BGP routes regardless of LPM.
id String
The provider-assigned unique ID for this managed resource.
provisioningState String
The provisioning state of the route resource.
etag string
A unique read-only string that changes whenever the resource is updated.
hasBgpOverride boolean
A value indicating whether this route overrides overlapping BGP routes regardless of LPM.
id string
The provider-assigned unique ID for this managed resource.
provisioningState string
The provisioning state of the route resource.
etag str
A unique read-only string that changes whenever the resource is updated.
has_bgp_override bool
A value indicating whether this route overrides overlapping BGP routes regardless of LPM.
id str
The provider-assigned unique ID for this managed resource.
provisioning_state str
The provisioning state of the route resource.
etag String
A unique read-only string that changes whenever the resource is updated.
hasBgpOverride Boolean
A value indicating whether this route overrides overlapping BGP routes regardless of LPM.
id String
The provider-assigned unique ID for this managed resource.
provisioningState String
The provisioning state of the route resource.

Supporting Types

RouteNextHopType
, RouteNextHopTypeArgs

VirtualNetworkGateway
VirtualNetworkGateway
VnetLocal
VnetLocal
Internet
Internet
VirtualAppliance
VirtualAppliance
None
None
RouteNextHopTypeVirtualNetworkGateway
VirtualNetworkGateway
RouteNextHopTypeVnetLocal
VnetLocal
RouteNextHopTypeInternet
Internet
RouteNextHopTypeVirtualAppliance
VirtualAppliance
RouteNextHopTypeNone
None
VirtualNetworkGateway
VirtualNetworkGateway
VnetLocal
VnetLocal
Internet
Internet
VirtualAppliance
VirtualAppliance
None
None
VirtualNetworkGateway
VirtualNetworkGateway
VnetLocal
VnetLocal
Internet
Internet
VirtualAppliance
VirtualAppliance
None
None
VIRTUAL_NETWORK_GATEWAY
VirtualNetworkGateway
VNET_LOCAL
VnetLocal
INTERNET
Internet
VIRTUAL_APPLIANCE
VirtualAppliance
NONE
None
"VirtualNetworkGateway"
VirtualNetworkGateway
"VnetLocal"
VnetLocal
"Internet"
Internet
"VirtualAppliance"
VirtualAppliance
"None"
None

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:network:Route route1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v2.82.0 published on Friday, Jan 10, 2025 by Pulumi