» vcd_network_direct

Provides a vCloud Director Org VDC Network directly connected to an external network. This can be used to create, modify, and delete internal networks for vApps to connect.

Supported in provider v2.0+

» Example Usage

resource "vcd_network_direct" "net" {
  org = "my-org" # Optional
  vdc = "my-vdc" # Optional

  name             = "my-net"
  external_network = "my-ext-net"
}

» Argument Reference

The following arguments are supported:

  • org - (Optional; v2.0+) The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
  • vdc - (Optional; v2.0+) The name of VDC to use, optional if defined at provider level
  • name - (Required) A unique name for the network
  • external_network - (Required) The name of the external network.
  • shared - (Optional) Defines if this network is shared between multiple VDCs in the Org. Defaults to false.

» Attribute reference

Supported in provider v2.5+

» Importing

Supported in provider v2.5+

An existing direct network can be imported into this resource via supplying its path. The path for this resource is made of orgName.vdcName.networkName. For example, using this structure, representing a direct network that was not created using Terraform:

resource "vcd_network_direct" "tf-mynet" {
  name              = "my-net"
  org               = "my-org"
  vdc               = "my-vdc"
  external_network  = "COMPUTE"
}

You can import such isolated network into terraform state using this command

terraform import vcd_network_direct.tf-mynet my-org.my-vdc.my-net

NOTE: the default separator (.) can be changed using Provider.import_separator or variable VCD_IMPORT_SEPARATOR

After importing, if you run terraform plan you will see the rest of the values and modify the script accordingly for further operations.