Skip to content

transport_zone_path is not optional on nsxt_policy_segment resource #742

@scharrier-revolve

Description

@scharrier-revolve

Describe the bug

When creating a nsxt_policy_segment on a custom Tier-1 using VMC SDDC 1.18 version the argument transport_zone_path is not optional (but it is optional in the documentation - https://registry.terraform.io/providers/vmware/nsxt/latest/docs/resources/policy_segment#transport_zone_path)

So you must specify nsxt_policy_transport_zone resource before creating the segment :

data "nsxt_policy_transport_zone" "overlay_tz" {
  display_name = "vmc-overlay-tz"
}

resource "nsxt_policy_segment" "segment" {
  nsx_id              = "segment_name"
  display_name        = "segment_name"
  description         = "Segment description"
  connectivity_path   = nsxt_policy_tier1_gateway.tier1_gw.path
  transport_zone_path = data.nsxt_policy_transport_zone.overlay_tz.path

  [...]
}

This is not useful because in VMC there is only one existing Transport Zone (vmc-overlay-tz) and when you create a segment from NSX-T UI you don"t need to provide any Transport Zone parameter and the transport_zone_path field is not present in the NSX-T API

Terraform error detail :

nsxt_policy_segment.segment: Creating...
╷
│ Error: transport_zone_path needs to be specified for infra segment on local manager
│ 
│   with nsxt_policy_segment.segment,
│   on segments.tf line 20, in resource "nsxt_policy_segment" "segment":
│   20: resource "nsxt_policy_segment" "segment" {

Reproduction steps

Try to create a nsxt_policy_segment without transport_zone_path argument (with VMC SDDC 1.18/NSX-T 3.1.5)


resource "nsxt_policy_segment" "segment" {
  nsx_id              = "segment_name"
  display_name        = "segment_name"
  description         = "Segment description"
  connectivity_path   = nsxt_policy_tier1_gateway.tier1_gw.path

  advanced_config {
    connectivity = "ON"
    hybrid       = false
    local_egress = false
    urpf_mode    = "STRICT"
  }

  subnet {
    cidr = "10.0.0.254/24"
  }
}

Expected behavior

nsxt_policy_segment must be able to be created without need to provide transport_zone_path argument on VMC

Consider documentation should be updated in this context (using VMC SDDC 1.18/NSX-T 3.1.5 versions when creating segments on custom Tier-1)

Additional context

Coming to VMC SDDC 1.18/NSX-T 3.1.5 versions Multi Tier-1 support is possible

nsxt_policy_segment must be used when you creating a segment under a custom Tier-1 instead of nsxt_policy_fixed_segment

nsxt_policy_fixed_segment still needed for segments created under default Tier-1 (cgw)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions