azurermVirtualHubRouteTableRoute
Manages a Route in a Virtual Hub Route Table.
\~> Note: Route table routes can managed with this resource, or in-line with the virtual_hub_route_table resource. Using both is not supported.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
this,
"example_1",
{
address_space: ["10.5.0.0/16"],
location: azurermResourceGroupExample.location,
name: "example-vnet",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermVirtualWanExample = new azurerm.virtualWan.VirtualWan(
this,
"example_2",
{
location: azurermResourceGroupExample.location,
name: "example-vwan",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualWanExample.overrideLogicalId("example");
const azurermNetworkSecurityGroupExample =
new azurerm.networkSecurityGroup.NetworkSecurityGroup(this, "example_3", {
location: azurermResourceGroupExample.location,
name: "example-nsg",
resource_group_name: azurermResourceGroupExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetworkSecurityGroupExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_4", {
address_prefixes: ["10.5.1.0/24"],
name: "examplesubnet",
resource_group_name: azurermResourceGroupExample.name,
virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermSubnetNetworkSecurityGroupAssociationExample =
new azurerm.subnetNetworkSecurityGroupAssociation.SubnetNetworkSecurityGroupAssociation(
this,
"example_5",
{
network_security_group_id: azurermNetworkSecurityGroupExample.id,
subnet_id: azurermSubnetExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetNetworkSecurityGroupAssociationExample.overrideLogicalId(
"example"
);
const azurermVirtualHubExample = new azurerm.virtualHub.VirtualHub(
this,
"example_6",
{
address_prefix: "10.0.2.0/24",
location: azurermResourceGroupExample.location,
name: "example-vhub",
resource_group_name: azurermResourceGroupExample.name,
virtual_wan_id: azurermVirtualWanExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualHubExample.overrideLogicalId("example");
const azurermVirtualHubRouteTableExample =
new azurerm.virtualHubRouteTable.VirtualHubRouteTable(this, "example_7", {
labels: ["label1"],
name: "example-vhubroutetable",
virtual_hub_id: azurermVirtualHubExample.id,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualHubRouteTableExample.overrideLogicalId("example");
const azurermVirtualHubConnectionExample =
new azurerm.virtualHubConnection.VirtualHubConnection(this, "example_8", {
name: "example-vhubconn",
remote_virtual_network_id: azurermVirtualNetworkExample.id,
routing: [
{
associated_route_table_id: azurermVirtualHubRouteTableExample.id,
},
],
virtual_hub_id: azurermVirtualHubExample.id,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualHubConnectionExample.overrideLogicalId("example");
const azurermVirtualHubRouteTableRouteExample =
new azurerm.virtualHubRouteTableRoute.VirtualHubRouteTableRoute(
this,
"example_9",
{
destinations: ["10.0.0.0/16"],
destinations_type: "CIDR",
name: "example-route",
next_hop: azurermVirtualHubConnectionExample.id,
next_hop_type: "ResourceId",
route_table_id: azurermVirtualHubRouteTableExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualHubRouteTableRouteExample.overrideLogicalId("example");
Arguments Reference
The following arguments are supported:
-
routeTableId
- (Required) The ID of the Virtual Hub Route Table to link this route to. Changing this forces a new resource to be created. -
name
- (Required) The name which should be used for this route. Changing this forces a new resource to be created. -
destinations
- (Required) A list of destination addresses for this route. -
destinationsType
- (Required) The type of destinations. Possible values arecidr
,resourceId
andservice
. -
nextHop
- (Required) The next hop's resource ID. -
nextHopType
- (Optional) The type of next hop. Currently the only possible value isresourceId
. Defaults toresourceId
.
Attributes Reference
The following attributes are exported:
id
- The ID of the Virtual Hub Route Table.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Virtual Hub Route Table.read
- (Defaults to 5 minutes) Used when retrieving the Virtual Hub Route Table.update
- (Defaults to 30 minutes) Used when updating the Virtual Hub Route Table.delete
- (Defaults to 30 minutes) Used when deleting the Virtual Hub Route Table.
Import
Virtual Hub Route Table Routes can be imported using <routeTableResourceId>/routes/<routeName>
, e.g.