Files
tf_examples/vm_v3_minimal/network.tf
T

36 lines
1.2 KiB
Terraform

# Allocate organization-level public IP capacity after the VDC and Edge exist.
resource "nubes_vc_org_ip_allocation" "org_ip" {
# Existing organization used by the VDC.
organization = var.organization
# Configure the selected IP space with the tested minimum count of 3.
# The API expects count as a string inside the vIPConfigure JSON array.
vip_configure = jsonencode([
{
name = var.ip_space_name
count = tostring(var.org_vip_count)
}
])
# Keep the organization allocation when this Terraform resource is destroyed.
keep_on_destroy = true
# PROD exposes the organization's usable IP spaces after the VDC and Edge exist.
depends_on = [nubes_vc_nsxt.edge]
}
# Enable the tested SNAT configuration on the Edge using the same IP space.
resource "nubes_vc_nsxt_snat" "snat" {
# UUID of the Edge created above.
nsxt_uid = nubes_vc_nsxt.edge.id
# IP space allocated to the organization in the resource above.
ip_space_name = var.ip_space_name
# Leave SNAT enabled when this Terraform resource is destroyed.
keep_on_destroy = true
# The IP space must be allocated before SNAT is configured.
depends_on = [nubes_vc_org_ip_allocation.org_ip]
}