-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vcd_nsxt_edgegateway external_network should ignore primary_ip if not set #1267
Comments
Hello @xorinzor , |
Hi, it is not. I excluded everything that I deemed irrelevant due to the confidential nature of the code. |
Could you try to just maintain the structure with all fields, but anonimise data? There may be some limitations that we can't overcome due to how Terraform schema works, but here is what I tried and it seems to work. Subsequent plans are clean once it is created. resource "vcd_nsxt_edgegateway" "nsxt-edge" {
org = "v51"
owner_id = vcd_vdc_group.test1.id
name = "TestAccVcdNsxtEdgeGatewayVdcGroupExternalUplink-edge"
description = "Description"
external_network_id = vcd_external_network_v2.ext-net-nsxt-t0.id
subnet {
gateway = tolist(vcd_external_network_v2.ext-net-nsxt-t0.ip_scope)[0].gateway
prefix_length = tolist(vcd_external_network_v2.ext-net-nsxt-t0.ip_scope)[0].prefix_length
primary_ip = tolist(tolist(vcd_external_network_v2.ext-net-nsxt-t0.ip_scope)[0].static_ip_pool)[0].end_address
allocated_ips {
start_address = tolist(tolist(vcd_external_network_v2.ext-net-nsxt-t0.ip_scope)[0].static_ip_pool)[0].end_address
end_address = tolist(tolist(vcd_external_network_v2.ext-net-nsxt-t0.ip_scope)[0].static_ip_pool)[0].end_address
}
}
external_network {
external_network_id = vcd_external_network_v2.segment-backed.id
gateway = tolist(vcd_external_network_v2.segment-backed.ip_scope)[0].gateway
prefix_length = tolist(vcd_external_network_v2.segment-backed.ip_scope)[0].prefix_length
allocated_ip_count = 2
}
external_network {
external_network_id = vcd_external_network_v2.segment-backed2.id
gateway = tolist(vcd_external_network_v2.segment-backed2.ip_scope)[0].gateway
prefix_length = tolist(vcd_external_network_v2.segment-backed2.ip_scope)[0].prefix_length
allocated_ip_count = 8
}
} |
Terraform Version
1.7.1
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
When the plan is applied, a subsequent plan should indicate no changes as no
primary_ip
is defined in the config and thus should be left as-is.Actual Behavior
When the plan is applied, a subsequent plan removes and recreates the
external_network
because theprimary_ip
has been automatically assigned.Steps to Reproduce
terraform apply
to apply the initial stateterraform plan
to show that terraform wants to recreate theexternal_network
The text was updated successfully, but these errors were encountered: