azure-native.network.Route
Explore with Pulumi AI
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",
    });
});
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
	})
}
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());
    }
}
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",
});
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")
resources:
  route:
    type: azure-native:network:Route
    properties:
      addressPrefix: 10.0.3.0/24
      nextHopType: VirtualNetworkGateway
      resourceGroupName: rg1
      routeName: route1
      routeTableName: testrt
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)type: azure-native:network:Route
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 RouteArgs
- 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 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 string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
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());
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")
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",
});
type: azure-native:network:Route
properties:
    addressPrefix: string
    id: string
    name: string
    nextHopIpAddress: string
    nextHopType: string
    resourceGroupName: string
    routeName: string
    routeTableName: string
    type: string
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:
- NextHop string | Pulumi.Type Azure Native. Network. Route Next Hop Type 
- The type of Azure hop the packet should be sent to.
- ResourceGroup stringName 
- The name of the resource group.
- RouteTable stringName 
- 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.
- NextHop stringIp Address 
- The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
- RouteName string
- The name of the route.
- Type string
- The type of the resource.
- NextHop string | RouteType Next Hop Type 
- The type of Azure hop the packet should be sent to.
- ResourceGroup stringName 
- The name of the resource group.
- RouteTable stringName 
- 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.
- NextHop stringIp Address 
- The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
- RouteName string
- The name of the route.
- Type string
- The type of the resource.
- nextHop String | RouteType Next Hop Type 
- The type of Azure hop the packet should be sent to.
- resourceGroup StringName 
- The name of the resource group.
- routeTable StringName 
- 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.
- nextHop StringIp Address 
- The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
- routeName String
- The name of the route.
- type String
- The type of the resource.
- nextHop string | RouteType Next Hop Type 
- The type of Azure hop the packet should be sent to.
- resourceGroup stringName 
- The name of the resource group.
- routeTable stringName 
- 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.
- nextHop stringIp Address 
- The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
- routeName string
- The name of the route.
- type string
- The type of the resource.
- next_hop_ str | Routetype Next Hop Type 
- The type of Azure hop the packet should be sent to.
- resource_group_ strname 
- The name of the resource group.
- route_table_ strname 
- 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_ strip_ address 
- 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 str
- The name of the route.
- type str
- The type of the resource.
- nextHop String | "VirtualType Network Gateway" | "Vnet Local" | "Internet" | "Virtual Appliance" | "None" 
- The type of Azure hop the packet should be sent to.
- resourceGroup StringName 
- The name of the resource group.
- routeTable StringName 
- 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.
- nextHop StringIp Address 
- The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
- routeName 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.
- HasBgp boolOverride 
- 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.
- HasBgp boolOverride 
- 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.
- hasBgp BooleanOverride 
- 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.
- hasBgp booleanOverride 
- 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_ booloverride 
- 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.
- hasBgp BooleanOverride 
- 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        
- VirtualNetwork Gateway 
- VirtualNetworkGateway
- VnetLocal 
- VnetLocal
- Internet
- Internet
- VirtualAppliance 
- VirtualAppliance
- None
- None
- RouteNext Hop Type Virtual Network Gateway 
- VirtualNetworkGateway
- RouteNext Hop Type Vnet Local 
- VnetLocal
- RouteNext Hop Type Internet 
- Internet
- RouteNext Hop Type Virtual Appliance 
- VirtualAppliance
- RouteNext Hop Type None 
- None
- VirtualNetwork Gateway 
- VirtualNetworkGateway
- VnetLocal 
- VnetLocal
- Internet
- Internet
- VirtualAppliance 
- VirtualAppliance
- None
- None
- VirtualNetwork Gateway 
- VirtualNetworkGateway
- VnetLocal 
- VnetLocal
- Internet
- Internet
- VirtualAppliance 
- VirtualAppliance
- None
- None
- VIRTUAL_NETWORK_GATEWAY
- VirtualNetworkGateway
- VNET_LOCAL
- VnetLocal
- INTERNET
- Internet
- VIRTUAL_APPLIANCE
- VirtualAppliance
- NONE
- None
- "VirtualNetwork Gateway" 
- 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} 
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0