azurestack_virtual_network_gateway

Manages a Virtual Network Gateway to establish secure, cross-premises connectivity.

Example Usage

resource "azurestack_resource_group" "test" {
  name     = "test"
  location = "Azure-stack-region"
}

resource "azurestack_virtual_network" "test" {
  name                = "test"
  location            = azurestack_resource_group.test.location
  resource_group_name = azurestack_resource_group.test.name
  address_space       = ["10.0.0.0/16"]
}

resource "azurestack_subnet" "test" {
  name                 = "GatewaySubnet"
  resource_group_name  = azurestack_resource_group.test.name
  virtual_network_name = azurestack_virtual_network.test.name
  address_prefix       = "10.0.1.0/24"
}

resource "azurestack_public_ip" "test" {
  name                         = "test"
  location                     = azurestack_resource_group.test.location
  resource_group_name          = azurestack_resource_group.test.name
  public_ip_address_allocation = "Dynamic"
}

resource "azurestack_virtual_network_gateway" "test" {
  name                = "test"
  location            = azurestack_resource_group.test.location
  resource_group_name = azurestack_resource_group.test.name

  type     = "Vpn"
  vpn_type = "RouteBased"
  sku      = "Basic"

  ip_configuration {
    public_ip_address_id          = azurestack_public_ip.test.id
    private_ip_address_allocation = "Dynamic"
    subnet_id                     = azurestack_subnet.test.id
  }
}

Argument Reference

The following arguments are supported:

The ip_configuration block supports:

The vpn_client_configuration block supports:

The bgp_settings block supports:

The root_certificate block supports:


The revoked_certificate block supports:

Attributes Reference

The following attributes are exported:

Import

Virtual Network Gateways can be imported using the resource id, e.g.

terraform import azurestack_virtual_network_gateway.testGateway /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup1/providers/Microsoft.Network/virtualNetworkGateways/myGateway1