Skip to content

azurermExpressRouteConnection

Manages an Express Route Connection.

\~> NOTE: The provider status of the Express Route Circuit must be set as provisioned while creating the Express Route Connection. See more details here.

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 azurermVirtualWanExample = new azurerm.virtualWan.VirtualWan(
  this,
  "example_1",
  {
    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 azurermExpressRoutePortExample =
  new azurerm.expressRoutePort.ExpressRoutePort(this, "example_2", {
    bandwidth_in_gbps: 10,
    encapsulation: "Dot1Q",
    location: azurermResourceGroupExample.location,
    name: "example-erp",
    peering_location: "Equinix-Seattle-SE2",
    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.*/
azurermExpressRoutePortExample.overrideLogicalId("example");
const azurermVirtualHubExample = new azurerm.virtualHub.VirtualHub(
  this,
  "example_3",
  {
    address_prefix: "10.0.1.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 azurermExpressRouteCircuitExample =
  new azurerm.expressRouteCircuit.ExpressRouteCircuit(this, "example_4", {
    bandwidth_in_gbps: 5,
    express_route_port_id: azurermExpressRoutePortExample.id,
    location: azurermResourceGroupExample.location,
    name: "example-erc",
    resource_group_name: azurermResourceGroupExample.name,
    sku: [
      {
        family: "MeteredData",
        tier: "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.*/
azurermExpressRouteCircuitExample.overrideLogicalId("example");
const azurermExpressRouteCircuitPeeringExample =
  new azurerm.expressRouteCircuitPeering.ExpressRouteCircuitPeering(
    this,
    "example_5",
    {
      express_route_circuit_name: azurermExpressRouteCircuitExample.name,
      peer_asn: 100,
      peering_type: "AzurePrivatePeering",
      primary_peer_address_prefix: "192.168.1.0/30",
      resource_group_name: azurermResourceGroupExample.name,
      secondary_peer_address_prefix: "192.168.2.0/30",
      shared_key: "ItsASecret",
      vlan_id: 100,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermExpressRouteCircuitPeeringExample.overrideLogicalId("example");
const azurermExpressRouteGatewayExample =
  new azurerm.expressRouteGateway.ExpressRouteGateway(this, "example_6", {
    location: azurermResourceGroupExample.location,
    name: "example-expressroutegateway",
    resource_group_name: azurermResourceGroupExample.name,
    scale_units: 1,
    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.*/
azurermExpressRouteGatewayExample.overrideLogicalId("example");
const azurermExpressRouteConnectionExample =
  new azurerm.expressRouteConnection.ExpressRouteConnection(this, "example_7", {
    express_route_circuit_peering_id:
      azurermExpressRouteCircuitPeeringExample.id,
    express_route_gateway_id: azurermExpressRouteGatewayExample.id,
    name: "example-expressrouteconn",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermExpressRouteConnectionExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Express Route Connection. Changing this forces a new resource to be created.

  • expressRouteCircuitPeeringId - (Required) The ID of the Express Route Circuit Peering that this Express Route Connection connects with. Changing this forces a new resource to be created.

  • expressRouteGatewayId - (Required) The ID of the Express Route Gateway that this Express Route Connection connects with. Changing this forces a new resource to be created.

  • authorizationKey - (Optional) The authorization key to establish the Express Route Connection.

  • enableInternetSecurity - (Optional) Is Internet security enabled for this Express Route Connection?

  • expressRouteGatewayBypassEnabled - (Optional) Specified whether Fast Path is enabled for Virtual Wan Firewall Hub. Defaults to false.

  • routing - (Optional) A routing block as defined below.

  • routingWeight - (Optional) The routing weight associated to the Express Route Connection. Possible value is between 0 and 32000. Defaults to 0.


A routing block supports the following:

  • associatedRouteTableId - (Optional) The ID of the Virtual Hub Route Table associated with this Express Route Connection.

  • inboundRouteMapId - (Optional) The ID of the Route Map associated with this Express Route Connection for inbound routes.

  • outboundRouteMapId - (Optional) The ID of the Route Map associated with this Express Route Connection for outbound routes.

  • propagatedRouteTable - (Optional) A propagatedRouteTable block as defined below.


A propagatedRouteTable block supports the following:

  • labels - (Optional) The list of labels to logically group route tables.

  • routeTableIds - (Optional) A list of IDs of the Virtual Hub Route Table to propagate routes from Express Route Connection to the route table.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Express Route Connection.

Timeouts

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

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

Import

Express Route Connections can be imported using the resourceId, e.g.

terraform import azurerm_express_route_connection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/expressRouteGateways/expressRouteGateway1/expressRouteConnections/connection1