Skip to content

azurermRouteServer

Manages an Azure Route Server

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.0.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "example-vn",
    resource_group_name: azurermResourceGroupExample.name,
    tags: {
      environment: "Production",
    },
  }
);
/*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 azurermPublicIpExample = new azurerm.publicIp.PublicIp(
  this,
  "example_2",
  {
    allocation_method: "Static",
    location: azurermResourceGroupExample.location,
    name: "example-pip",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPublicIpExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_3", {
  address_prefixes: ["10.0.1.0/24"],
  name: "RouteServerSubnet",
  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 azurermRouteServerExample = new azurerm.routeServer.RouteServer(
  this,
  "example_4",
  {
    branch_to_branch_traffic_enabled: true,
    location: azurermResourceGroupExample.location,
    name: "example-routerserver",
    public_ip_address_id: azurermPublicIpExample.id,
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard",
    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.*/
azurermRouteServerExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name of the Route Server. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) Specifies the name of the Resource Group where the Route Server should exist. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the Route Server should exist. Changing this forces a new resource to be created.

  • subnetId - (Required) The ID of the Subnet that the Route Server will reside. Changing this forces a new resource to be created.

-> NOTE: Azure Route Server requires a dedicated subnet named RouteServerSubnet. The subnet size has to be at least /27 or short prefix (such as /26 or /25) and cannot be attached to any security group, otherwise, you'll receive an error message when deploying the Route Server

  • sku - (Required) The SKU of the Route Server. The only possible value is standard. Changing this forces a new resource to be created.

  • publicIpAddressId - (Required) The ID of the Public IP Address. This option is required since September 1st 2021. Changing this forces a new resource to be created.

  • branchToBranchTrafficEnabled - (Optional) Whether to enable route exchange between Azure Route Server and the gateway(s)

  • tags - (Optional) A mapping of tags to assign to the resource.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Route Server .

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 60 minutes) Used when creating the Route Server.
  • read - (Defaults to 5 minutes) Used when retrieving the Route Server.
  • update - (Defaults to 60 minutes) Used when updating the Route Server.
  • delete - (Defaults to 60 minutes) Used when deleting the Route Server.

Import

Route Server can be imported using the resourceId, e.g.

terraform import azurerm_route_server.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualHubs/routeServer1