diff --git a/nsxt/data_source_nsxt_policy_transport_zone.go b/nsxt/data_source_nsxt_policy_transport_zone.go index 50f43dcdb..b7c79fc49 100644 --- a/nsxt/data_source_nsxt_policy_transport_zone.go +++ b/nsxt/data_source_nsxt_policy_transport_zone.go @@ -51,6 +51,11 @@ func dataSourceNsxtPolicyTransportZone() *schema.Resource { Optional: true, ValidateFunc: validatePolicyPath(), }, + "realized_id": { + Type: schema.TypeString, + Description: "The ID of the realized resource", + Computed: true, + }, }, } } @@ -90,6 +95,7 @@ func dataSourceNsxtPolicyTransportZoneRead(d *schema.ResourceData, m interface{} d.Set("is_default", transportZoneResource.IsDefault) d.Set("transport_type", transportZoneResource.TzType) d.Set("site_path", transportZoneResource.ParentPath) + d.Set("realized_id", transportZoneResource.RealizationId) return nil } connector := getPolicyConnector(m) @@ -159,5 +165,6 @@ func dataSourceNsxtPolicyTransportZoneRead(d *schema.ResourceData, m interface{} d.Set("path", obj.Path) d.Set("is_default", obj.IsDefault) d.Set("transport_type", obj.TzType) + d.Set("realized_id", obj.RealizationId) return nil } diff --git a/nsxt/data_source_nsxt_policy_transport_zone_test.go b/nsxt/data_source_nsxt_policy_transport_zone_test.go index 7aabd0b76..82e7f95f5 100644 --- a/nsxt/data_source_nsxt_policy_transport_zone_test.go +++ b/nsxt/data_source_nsxt_policy_transport_zone_test.go @@ -28,6 +28,7 @@ func TestAccDataSourceNsxtPolicyTransportZone_basic(t *testing.T) { resource.TestCheckResourceAttrSet(testResourceName, "id"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "is_default"), + resource.TestCheckResourceAttrSet(testResourceName, "realized_id"), resource.TestCheckResourceAttr(testResourceName, "transport_type", "VLAN_BACKED"), ), }, diff --git a/website/docs/d/policy_transport_zone.html.markdown b/website/docs/d/policy_transport_zone.html.markdown index 4ab7a6f54..20675e51e 100644 --- a/website/docs/d/policy_transport_zone.html.markdown +++ b/website/docs/d/policy_transport_zone.html.markdown @@ -54,3 +54,4 @@ In addition to arguments listed above, the following attributes are exported: * `is_default` - A boolean flag indicating if this Transport Zone is the default. * `transport_type` - The transport type of this transport zone. * `path` - The NSX path of the policy resource. +* `realized_id` - The id of realized transport zone object. This id should be used in `nsxt_edge_transport_node` resource.