terraform-provider-nsxt
terraform-provider-nsxt copied to clipboard
[nsxt_policy_vlan_segment] import command does not import advanced_config attribute
Describe the bug
When I import nsxt_policy_vlan_segment resource. It does not import advanced_config attribute
Reproduction steps
When I import *nsxt_policy_vlan_segment* resource. It does not import advanced_config attribute
Expected behavior
import advanced_config attribute
Additional context
No response
Hello, you need to specify advanced config in your terraform configuration prior to importing (as documented here https://registry.terraform.io/providers/vmware/nsxt/latest/docs/resources/policy_segment) This unfortunate limitation is due to API behavior change in one of recent NSX versions. Please let us know if it helped.
Hi @annakhm
I have a vlan segment with uplink teaming policy

I was set my TF as below
resource "nsxt_policy_vlan_segment" "t0_gateway_interface_ospf" {
display_name = "MCR-NSX-Edge-Uplink_OSPF_To_ACI_L3Out"
vlan_ids = ["0"]
transport_zone_path = data.nsxt_policy_transport_zone.edge_uplink.path
advanced_config {
connectivity = "ON"
}
}
and perform import
terraform import 'nsxt_policy_vlan_segment.t0_gateway_interface_ospf' MCR-NSX-Edge-Uplink_OSPF_To_ACI_L3Out
let show state
terraform state show nsxt_policy_vlan_segment.t0_gateway_interface_ospf
output
# nsxt_policy_vlan_segment.t0_gateway_interface_ospf:
resource "nsxt_policy_vlan_segment" "t0_gateway_interface_ospf" {
display_name = "MCR-NSX-Edge-Uplink_OSPF_To_ACI_L3Out"
id = "MCR-NSX-Edge-Uplink_OSPF_To_ACI_L3Out"
nsx_id = "MCR-NSX-Edge-Uplink_OSPF_To_ACI_L3Out"
path = "/infra/segments/MCR-NSX-Edge-Uplink_OSPF_To_ACI_L3Out"
replication_mode = "MTEP"
revision = 12
transport_zone_path = "/infra/sites/default/enforcement-points/default/transport-zones/cd43fda5-1502-4fa9-8cb1-2769e8db9aa4"
vlan_ids = [
"0",
]
}
VDS-PortGroup was not imported