Route
Manages a Route within a Route Table.
NOTE on Route Tables and Routes: This provider currently provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource. At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West US",
});
var exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new Azure.Network.RouteTableArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
});
var exampleRoute = new Azure.Network.Route("exampleRoute", new Azure.Network.RouteArgs
{
ResourceGroupName = exampleResourceGroup.Name,
RouteTableName = exampleRouteTable.Name,
AddressPrefix = "10.1.0.0/16",
NextHopType = "vnetlocal",
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/network"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West US"),
})
if err != nil {
return err
}
exampleRouteTable, err := network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
})
if err != nil {
return err
}
_, err = network.NewRoute(ctx, "exampleRoute", &network.RouteArgs{
ResourceGroupName: exampleResourceGroup.Name,
RouteTableName: exampleRouteTable.Name,
AddressPrefix: pulumi.String("10.1.0.0/16"),
NextHopType: pulumi.String("vnetlocal"),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
example_route_table = azure.network.RouteTable("exampleRouteTable",
location=example_resource_group.location,
resource_group_name=example_resource_group.name)
example_route = azure.network.Route("exampleRoute",
resource_group_name=example_resource_group.name,
route_table_name=example_route_table.name,
address_prefix="10.1.0.0/16",
next_hop_type="vnetlocal")import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"});
const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
});
const exampleRoute = new azure.network.Route("exampleRoute", {
resourceGroupName: exampleResourceGroup.name,
routeTableName: exampleRouteTable.name,
addressPrefix: "10.1.0.0/16",
nextHopType: "vnetlocal",
});Create a Route Resource
new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);def Route(resource_name, opts=None, address_prefix=None, name=None, next_hop_in_ip_address=None, next_hop_type=None, resource_group_name=None, route_table_name=None, __props__=None);public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Route Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Route resource accepts the following input properties:
- Address
Prefix string The destination CIDR to which the route applies, such as
10.1.0.0/16- Next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- Resource
Group stringName The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- Route
Table stringName The name of the route table within which create the route. Changing this forces a new resource to be created.
- Name string
The name of the route. Changing this forces a new resource to be created.
- Next
Hop stringIn Ip Address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.
- Address
Prefix string The destination CIDR to which the route applies, such as
10.1.0.0/16- Next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- Resource
Group stringName The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- Route
Table stringName The name of the route table within which create the route. Changing this forces a new resource to be created.
- Name string
The name of the route. Changing this forces a new resource to be created.
- Next
Hop stringIn Ip Address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.
- address
Prefix string The destination CIDR to which the route applies, such as
10.1.0.0/16- next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- resource
Group stringName The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- route
Table stringName The name of the route table within which create the route. Changing this forces a new resource to be created.
- name string
The name of the route. Changing this forces a new resource to be created.
- next
Hop stringIn Ip Address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.
- address_
prefix str The destination CIDR to which the route applies, such as
10.1.0.0/16- next_
hop_ strtype The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- resource_
group_ strname The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- route_
table_ strname The name of the route table within which create the route. Changing this forces a new resource to be created.
- name str
The name of the route. Changing this forces a new resource to be created.
- next_
hop_ strin_ ip_ address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.
Outputs
All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:
Look up an Existing Route Resource
Get an existing Route 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?: RouteState, opts?: CustomResourceOptions): Routestatic get(resource_name, id, opts=None, address_prefix=None, name=None, next_hop_in_ip_address=None, next_hop_type=None, resource_group_name=None, route_table_name=None, __props__=None);func GetRoute(ctx *Context, name string, id IDInput, state *RouteState, opts ...ResourceOption) (*Route, error)public static Route Get(string name, Input<string> id, RouteState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Address
Prefix string The destination CIDR to which the route applies, such as
10.1.0.0/16- Name string
The name of the route. Changing this forces a new resource to be created.
- Next
Hop stringIn Ip Address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.- Next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- Resource
Group stringName The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- Route
Table stringName The name of the route table within which create the route. Changing this forces a new resource to be created.
- Address
Prefix string The destination CIDR to which the route applies, such as
10.1.0.0/16- Name string
The name of the route. Changing this forces a new resource to be created.
- Next
Hop stringIn Ip Address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.- Next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- Resource
Group stringName The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- Route
Table stringName The name of the route table within which create the route. Changing this forces a new resource to be created.
- address
Prefix string The destination CIDR to which the route applies, such as
10.1.0.0/16- name string
The name of the route. Changing this forces a new resource to be created.
- next
Hop stringIn Ip Address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.- next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- resource
Group stringName The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- route
Table stringName The name of the route table within which create the route. Changing this forces a new resource to be created.
- address_
prefix str The destination CIDR to which the route applies, such as
10.1.0.0/16- name str
The name of the route. Changing this forces a new resource to be created.
- next_
hop_ strin_ ip_ address Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is
VirtualAppliance.- next_
hop_ strtype The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway,VnetLocal,Internet,VirtualApplianceandNone- resource_
group_ strname The name of the resource group in which to create the route. Changing this forces a new resource to be created.
- route_
table_ strname The name of the route table within which create the route. Changing this forces a new resource to be created.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.