Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Wang <[email protected]>
  • Loading branch information
wsquan171 committed Aug 22, 2023
1 parent 215548c commit aa9f4e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions nsxt/resource_nsxt_policy_transport_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions nsxt/resource_nsxt_policy_transport_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
Expand All @@ -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"),
),
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/policy_transport_zone.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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"
Expand All @@ -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

Expand Down

0 comments on commit aa9f4e3

Please sign in to comment.