azure.network.RouteTable
Explore with Pulumi AI
Manages a Route Table
NOTE on Route Tables and Routes: There is both a standalone
route
resource, and allows for Routes to be defined in-line within theroute_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 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 exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
DisableBgpRoutePropagation = false,
Routes = new[]
{
new Azure.Network.Inputs.RouteTableRouteArgs
{
Name = "route1",
AddressPrefix = "10.1.0.0/16",
NextHopType = "VnetLocal",
},
},
Tags =
{
{ "environment", "Production" },
},
});
});
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
}
_, err = network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
DisableBgpRoutePropagation: pulumi.Bool(false),
Routes: network.RouteTableRouteArray{
&network.RouteTableRouteArgs{
Name: pulumi.String("route1"),
AddressPrefix: pulumi.String("10.1.0.0/16"),
NextHopType: pulumi.String("VnetLocal"),
},
},
Tags: pulumi.StringMap{
"environment": pulumi.String("Production"),
},
})
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.RouteTable;
import com.pulumi.azure.network.RouteTableArgs;
import com.pulumi.azure.network.inputs.RouteTableRouteArgs;
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 exampleRouteTable = new RouteTable("exampleRouteTable", RouteTableArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.disableBgpRoutePropagation(false)
.routes(RouteTableRouteArgs.builder()
.name("route1")
.addressPrefix("10.1.0.0/16")
.nextHopType("VnetLocal")
.build())
.tags(Map.of("environment", "Production"))
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_route_table = azure.network.RouteTable("exampleRouteTable",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
disable_bgp_route_propagation=False,
routes=[azure.network.RouteTableRouteArgs(
name="route1",
address_prefix="10.1.0.0/16",
next_hop_type="VnetLocal",
)],
tags={
"environment": "Production",
})
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
disableBgpRoutePropagation: false,
routes: [{
name: "route1",
addressPrefix: "10.1.0.0/16",
nextHopType: "VnetLocal",
}],
tags: {
environment: "Production",
},
});
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
exampleRouteTable:
type: azure:network:RouteTable
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
disableBgpRoutePropagation: false
routes:
- name: route1
addressPrefix: 10.1.0.0/16
nextHopType: VnetLocal
tags:
environment: Production
Create RouteTable Resource
new RouteTable(name: string, args: RouteTableArgs, opts?: CustomResourceOptions);
@overload
def RouteTable(resource_name: str,
opts: Optional[ResourceOptions] = None,
disable_bgp_route_propagation: Optional[bool] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
routes: Optional[Sequence[RouteTableRouteArgs]] = None,
tags: Optional[Mapping[str, str]] = None)
@overload
def RouteTable(resource_name: str,
args: RouteTableArgs,
opts: Optional[ResourceOptions] = None)
func NewRouteTable(ctx *Context, name string, args RouteTableArgs, opts ...ResourceOption) (*RouteTable, error)
public RouteTable(string name, RouteTableArgs args, CustomResourceOptions? opts = null)
public RouteTable(String name, RouteTableArgs args)
public RouteTable(String name, RouteTableArgs args, CustomResourceOptions options)
type: azure:network:RouteTable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteTableArgs
- 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 RouteTableArgs
- 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 RouteTableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteTableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RouteTableArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RouteTable 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 RouteTable resource accepts the following input properties:
- Resource
Group stringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- Disable
Bgp boolRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
The name of the route.
- Routes
List<Route
Table Route Args> A list of objects representing routes. Each object accepts the arguments documented below.
- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Resource
Group stringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- Disable
Bgp boolRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
The name of the route.
- Routes
[]Route
Table Route Args A list of objects representing routes. Each object accepts the arguments documented below.
- map[string]string
A mapping of tags to assign to the resource.
- resource
Group StringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- disable
Bgp BooleanRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location String
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
The name of the route.
- routes
List<Route
Table Route Args> A list of objects representing routes. Each object accepts the arguments documented below.
- Map<String,String>
A mapping of tags to assign to the resource.
- resource
Group stringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- disable
Bgp booleanRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
The name of the route.
- routes
Route
Table Route Args[] A list of objects representing routes. Each object accepts the arguments documented below.
- {[key: string]: string}
A mapping of tags to assign to the resource.
- resource_
group_ strname The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- disable_
bgp_ boolroute_ propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location str
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
The name of the route.
- routes
Sequence[Route
Table Route Args] A list of objects representing routes. Each object accepts the arguments documented below.
- Mapping[str, str]
A mapping of tags to assign to the resource.
- resource
Group StringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- disable
Bgp BooleanRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location String
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
The name of the route.
- routes List<Property Map>
A list of objects representing routes. Each object accepts the arguments documented below.
- Map<String>
A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the RouteTable resource produces the following output properties:
Look up Existing RouteTable Resource
Get an existing RouteTable 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?: RouteTableState, opts?: CustomResourceOptions): RouteTable
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
disable_bgp_route_propagation: Optional[bool] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
routes: Optional[Sequence[RouteTableRouteArgs]] = None,
subnets: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None) -> RouteTable
func GetRouteTable(ctx *Context, name string, id IDInput, state *RouteTableState, opts ...ResourceOption) (*RouteTable, error)
public static RouteTable Get(string name, Input<string> id, RouteTableState? state, CustomResourceOptions? opts = null)
public static RouteTable get(String name, Output<String> id, RouteTableState 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.
- Disable
Bgp boolRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
The name of the route.
- Resource
Group stringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- Routes
List<Route
Table Route Args> A list of objects representing routes. Each object accepts the arguments documented below.
- Subnets List<string>
The collection of Subnets associated with this route table.
- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Disable
Bgp boolRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
The name of the route.
- Resource
Group stringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- Routes
[]Route
Table Route Args A list of objects representing routes. Each object accepts the arguments documented below.
- Subnets []string
The collection of Subnets associated with this route table.
- map[string]string
A mapping of tags to assign to the resource.
- disable
Bgp BooleanRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location String
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
The name of the route.
- resource
Group StringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- routes
List<Route
Table Route Args> A list of objects representing routes. Each object accepts the arguments documented below.
- subnets List<String>
The collection of Subnets associated with this route table.
- Map<String,String>
A mapping of tags to assign to the resource.
- disable
Bgp booleanRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
The name of the route.
- resource
Group stringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- routes
Route
Table Route Args[] A list of objects representing routes. Each object accepts the arguments documented below.
- subnets string[]
The collection of Subnets associated with this route table.
- {[key: string]: string}
A mapping of tags to assign to the resource.
- disable_
bgp_ boolroute_ propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location str
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
The name of the route.
- resource_
group_ strname The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- routes
Sequence[Route
Table Route Args] A list of objects representing routes. Each object accepts the arguments documented below.
- subnets Sequence[str]
The collection of Subnets associated with this route table.
- Mapping[str, str]
A mapping of tags to assign to the resource.
- disable
Bgp BooleanRoute Propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable.
- location String
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
The name of the route.
- resource
Group StringName The name of the resource group in which to create the route table. Changing this forces a new resource to be created.
- routes List<Property Map>
A list of objects representing routes. Each object accepts the arguments documented below.
- subnets List<String>
The collection of Subnets associated with this route table.
- Map<String>
A mapping of tags to assign to the resource.
Supporting Types
RouteTableRoute
- Address
Prefix string The destination to which the route applies. Can be CIDR (such as
10.1.0.0/16
) or Azure Service Tag (such asApiManagement
,AzureBackup
orAzureMonitor
) format.- Name string
The name of the route.
- Next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway
,VnetLocal
,Internet
,VirtualAppliance
andNone
.- 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 to which the route applies. Can be CIDR (such as
10.1.0.0/16
) or Azure Service Tag (such asApiManagement
,AzureBackup
orAzureMonitor
) format.- Name string
The name of the route.
- Next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway
,VnetLocal
,Internet
,VirtualAppliance
andNone
.- 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 to which the route applies. Can be CIDR (such as
10.1.0.0/16
) or Azure Service Tag (such asApiManagement
,AzureBackup
orAzureMonitor
) format.- name String
The name of the route.
- next
Hop StringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway
,VnetLocal
,Internet
,VirtualAppliance
andNone
.- 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 to which the route applies. Can be CIDR (such as
10.1.0.0/16
) or Azure Service Tag (such asApiManagement
,AzureBackup
orAzureMonitor
) format.- name string
The name of the route.
- next
Hop stringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway
,VnetLocal
,Internet
,VirtualAppliance
andNone
.- 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 to which the route applies. Can be CIDR (such as
10.1.0.0/16
) or Azure Service Tag (such asApiManagement
,AzureBackup
orAzureMonitor
) format.- name str
The name of the route.
- next_
hop_ strtype The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway
,VnetLocal
,Internet
,VirtualAppliance
andNone
.- 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
.
- address
Prefix String The destination to which the route applies. Can be CIDR (such as
10.1.0.0/16
) or Azure Service Tag (such asApiManagement
,AzureBackup
orAzureMonitor
) format.- name String
The name of the route.
- next
Hop StringType The type of Azure hop the packet should be sent to. Possible values are
VirtualNetworkGateway
,VnetLocal
,Internet
,VirtualAppliance
andNone
.- 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
.
Import
Route Tables can be imported using the resource id
, e.g.
$ pulumi import azure:network/routeTable:RouteTable example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/routeTables/mytable1
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.