diff --git a/nsxt/resource_nsxt_policy_transport_zone.go b/nsxt/resource_nsxt_policy_transport_zone.go index f59142fbf..70e4b6b33 100644 --- a/nsxt/resource_nsxt_policy_transport_zone.go +++ b/nsxt/resource_nsxt_policy_transport_zone.go @@ -64,7 +64,7 @@ func resourceNsxtPolicyTransportZone() *schema.Resource { Default: defaultInfraSitePath, ValidateFunc: validatePolicyPath(), }, - "enforcement_point_id": { + "enforcement_point": { Type: schema.TypeString, Description: "ID of the enforcement point this Transport Zone belongs to", Optional: true, @@ -154,7 +154,7 @@ func policyTransportZoneIDTuple(d *schema.ResourceData, m interface{}) (id, site err = fmt.Errorf("error obtaining Site ID from site path %s", sitePath) return } - epID = d.Get("enforcement_point_id").(string) + epID = d.Get("enforcement_point").(string) if epID == "" { epID = getPolicyEnforcementPoint(m) } @@ -173,7 +173,7 @@ func resourceNsxtPolicyTransportZoneCreate(d *schema.ResourceData, m interface{} if siteID == "" { return fmt.Errorf("error obtaining Site ID from site path %s", sitePath) } - epID := d.Get("enforcement_point_id").(string) + epID := d.Get("enforcement_point").(string) if epID == "" { epID = getPolicyEnforcementPoint(m) } @@ -217,7 +217,7 @@ func resourceNsxtPolicyTransportZoneRead(d *schema.ResourceData, m interface{}) } d.Set("site_path", sitePath) - d.Set("enforcement_point_id", epID) + d.Set("enforcement_point", epID) d.Set("display_name", obj.DisplayName) d.Set("description", obj.Description) setPolicyTagsInSchema(d, obj.Tags) @@ -275,7 +275,7 @@ func resourceNsxtPolicyTransportZoneImporter(d *schema.ResourceData, m interface if err != nil { return nil, err } - d.Set("enforcement_point_id", epID) + d.Set("enforcement_point", epID) sitePath, err := getSitePathFromChildResourcePath(importID) if err != nil { return rd, err diff --git a/nsxt/resource_nsxt_policy_transport_zone_test.go b/nsxt/resource_nsxt_policy_transport_zone_test.go index 1da27d8db..5df72a570 100644 --- a/nsxt/resource_nsxt_policy_transport_zone_test.go +++ b/nsxt/resource_nsxt_policy_transport_zone_test.go @@ -51,7 +51,7 @@ func TestAccResourceNsxtPolicyTransportZone_basic(t *testing.T) { resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), resource.TestCheckResourceAttrSet(testResourceName, "is_default"), - resource.TestCheckResourceAttrSet(testResourceName, "enforcement_point_id"), + resource.TestCheckResourceAttrSet(testResourceName, "enforcement_point"), resource.TestCheckResourceAttrSet(testResourceName, "site_path"), resource.TestCheckResourceAttr(testResourceName, "tag.#", "1"), ), @@ -68,7 +68,7 @@ func TestAccResourceNsxtPolicyTransportZone_basic(t *testing.T) { resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), resource.TestCheckResourceAttrSet(testResourceName, "is_default"), - resource.TestCheckResourceAttrSet(testResourceName, "enforcement_point_id"), + resource.TestCheckResourceAttrSet(testResourceName, "enforcement_point"), resource.TestCheckResourceAttrSet(testResourceName, "site_path"), resource.TestCheckResourceAttr(testResourceName, "tag.#", "0"), ), @@ -133,7 +133,7 @@ func testAccNsxtPolicyTransportZoneExists(displayName string, resourceName strin if tzID == "" { return fmt.Errorf("PolicyTransportZone resource ID not set in resources") } - epID := rs.Primary.Attributes["enforcement_point_id"] + epID := rs.Primary.Attributes["enforcement_point"] sitePath := rs.Primary.Attributes["site_path"] siteID := getPolicyIDFromPath(sitePath) exists, err := resourceNsxtPolicyTransportZoneExists(siteID, epID, tzID, connector) @@ -157,7 +157,7 @@ func testAccNsxtPolicyTransportZoneCheckDestroy(state *terraform.State, displayN } tzID := rs.Primary.Attributes["id"] - epID := rs.Primary.Attributes["enforcement_point_id"] + epID := rs.Primary.Attributes["enforcement_point"] sitePath := rs.Primary.Attributes["site_path"] siteID := getPolicyIDFromPath(sitePath) exists, err := resourceNsxtPolicyTransportZoneExists(siteID, epID, tzID, connector) diff --git a/website/docs/r/policy_transport_zone.html.markdown b/website/docs/r/policy_transport_zone.html.markdown index dd2f881ee..2a05d9a5d 100644 --- a/website/docs/r/policy_transport_zone.html.markdown +++ b/website/docs/r/policy_transport_zone.html.markdown @@ -7,7 +7,7 @@ description: A resource to configure Policy Transport Zone. # nsxt_policy_transport_zone -This resource provides a method for the management of Policy based Transport Zones (TZ). A Transport Zone defines the scope to which a network can extend in NSX. For example an overlay based Transport Zone is associated with both hypervisors and logical switches and defines which hypervisors will be able to serve the defined logical switch. Virtual machines on the hypervisor associated with a Transport Zone can be attached to logical switches in that same Transport Zone. +This resource provides a method for the management of Policy based Transport Zones (TZ). A Transport Zone defines the scope to which a network can extend in NSX. For example an overlay based Transport Zone is associated with both hypervisors and segments and defines which hypervisors will be able to serve the defined segment. Virtual machines on the hypervisor associated with a Transport Zone can be attached to segments in that same Transport Zone. This data source is applicable to NSX Policy Manager. @@ -28,7 +28,7 @@ resource "nsxt_policy_transport_zone" "vlan_transport_zone" { is_default = true uplink_teaming_policy_names = ["teaming-1"] site_path = "/infra/sites/default" - enforcement_point_id = "default" + enforcement_point = "default" tag { scope = "app" @@ -47,7 +47,7 @@ resource "nsxt_policy_transport_zone" "vlan_transport_zone" { * `is_default` - (Optional) Set this Transport Zone as the default zone of given `transport_type`. Default value is `false`. When setting a Transport Zone with `is_default`: `true`, no existing Transport Zone of same `transport_type` should be set as default. * `uplink_teaming_policy_names` - (Optional) The names of switching uplink teaming policies that all transport nodes in this transport zone support. Uplinkin teaming policies are only valid for `VLAN_BACKED` transport zones. * `site_path` - (Optional) The path of the site which the Transport Zone belongs to. `path` field of the existing `nsxt_policy_site` can be used here. -* `enforcement_point_id` - (Optional) The ID of enforcement point under given `site_path` to manage the Transport Zone. +* `enforcement_point` - (Optional) The ID of enforcement point under given `site_path` to manage the Transport Zone. ## Attributes Reference