diff --git a/acc-testcases/resources/network.yaml b/acc-testcases/resources/network.yaml index 3b0420c9..1a0086f9 100644 --- a/acc-testcases/resources/network.yaml +++ b/acc-testcases/resources/network.yaml @@ -3,12 +3,20 @@ vars: acc: - config: | name = "$(network_name)" - group_id = "shared" - active = true - dhcp_server = true - description = "Network created using tf" - cidr = "168.72.10.0/18" - gateway = "168.72.10.10" - pool_id = 6 - -ignore: true + description = "Network created using tf" + group_id = "shared" + scope_id = "88cd4dc8-0445-4b8e-b260-0f4cd361f4e1" + cidr = "172.16.10.1/24" + gateway = "172.16.10.1" + pool_id = 7 + scan_network = false + active = true + config { + connected_gateway = "/infra/tier-1s/26cdb82e-0057-4461-ad4d-cddd61d77b1f" + } + resource_permissions { + all = true + } + validations: + tf.cidr = "172.16.10.1/24" + tf.gateway = "172.16.10.1" diff --git a/examples/resources/hpegl_vmaas_network/nsx_t_segment.tf b/examples/resources/hpegl_vmaas_network/nsx_t_segment.tf index 6d8bde7d..1bb8b99f 100644 --- a/examples/resources/hpegl_vmaas_network/nsx_t_segment.tf +++ b/examples/resources/hpegl_vmaas_network/nsx_t_segment.tf @@ -5,10 +5,11 @@ resource "hpegl_vmaas_network" "test_net" { description = "Network created using tf" group_id = data.hpegl_vmaas_group.tf_group.id scope_id = data.hpegl_vmaas_transport_zone.tf_zone.provider_id - cidr = "168.72.10.0/18" + cidr = "168.72.10.1/18" gateway = "168.72.10.1" primary_dns = "8.8.8.8" scan_network = false + pool_id = 7 active = true config { connected_gateway = data.hpegl_vmaas_router.tf_router.provider_id diff --git a/go.mod b/go.mod index 6f84e236..d8c9b1b2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/HewlettPackard/hpegl-vmaas-terraform-resources go 1.17 require ( - github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211213133614-34ada49ff436 + github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211210061100-0d6f0303264c github.com/golang/mock v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.5.1 diff --git a/go.sum b/go.sum index d763ecc6..6b9f82d2 100644 --- a/go.sum +++ b/go.sum @@ -49,8 +49,12 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211209082955-2fdf3fec9f1f h1:cvuFBy9zF4KtT9aijrxB3dJ6Vs3Fi6jsI/S4LN7enpQ= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211209082955-2fdf3fec9f1f/go.mod h1:QqQ2OwCQ1qmsMPscU2Y5MeLJP3Q5BPeaTE13s6hu7I8= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211210061100-0d6f0303264c h1:NerBcU4IIXERaTKkWFPmTl82ExfkaPr/gfJ70OLlWVg= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211210061100-0d6f0303264c/go.mod h1:QqQ2OwCQ1qmsMPscU2Y5MeLJP3Q5BPeaTE13s6hu7I8= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211213133614-34ada49ff436 h1:cqshdX6z20q4/9Rn905Pvpea7Of6MybjqH+EYl4toBU= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211213133614-34ada49ff436/go.mod h1:QqQ2OwCQ1qmsMPscU2Y5MeLJP3Q5BPeaTE13s6hu7I8= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211214084713-7f5f8ad0d51b h1:lh03lX9v59YBu8o5xsYJ6d6lGctwK/w6VFaAEKFAkQQ= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.1-0.20211214084713-7f5f8ad0d51b/go.mod h1:QqQ2OwCQ1qmsMPscU2Y5MeLJP3Q5BPeaTE13s6hu7I8= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= diff --git a/internal/cmp/resource_network.go b/internal/cmp/resource_network.go index 49c9eb34..3d6be6cd 100644 --- a/internal/cmp/resource_network.go +++ b/internal/cmp/resource_network.go @@ -140,9 +140,6 @@ func (r *resNetwork) Delete(ctx context.Context, d *utils.Data, meta interface{} func alignNetworkReq(request *models.CreateNetwork) { request.Site.ID = request.GroupID - if request.PoolID != 0 { - request.Pool = &models.IDModel{ID: request.PoolID} - } if request.NetworkDomainID != 0 { request.NetworkDomain = &models.IDModel{ID: request.NetworkDomainID} } diff --git a/templates/resources/vmaas_network.md.tmpl b/templates/resources/vmaas_network.md.tmpl index 157fa884..dd9e29c4 100644 --- a/templates/resources/vmaas_network.md.tmpl +++ b/templates/resources/vmaas_network.md.tmpl @@ -18,4 +18,7 @@ For creating an NSX-T network please refer following examples. {{tffile "examples/resources/hpegl_vmaas_network/nsx_t_segment.tf"}} +-> Transport Zone Data Source `hpegl_vmaas_transport_zone` which is used for the +`scope_id` is supported from 5.2.13. + {{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/vmaas_router.md.tmpl b/templates/resources/vmaas_router.md.tmpl index 079d7693..a842f8db 100644 --- a/templates/resources/vmaas_router.md.tmpl +++ b/templates/resources/vmaas_router.md.tmpl @@ -16,6 +16,8 @@ For creating an NSX-T Tier0/Tier1 network router please refer following examples -> NSX-T Tier0 & Tier1 router are considered as different instances. So you can create either Tier0 or Tier1 at a given time. +-> Edge Cluster Data Source `hpegl_vmaas_edge_cluster` is supported from 5.2.13. + ## Example usage for creating NSX-T Tier0 Network router with all possible attributes -> Incase of NSX-T Tier0 network router creation, `fail_over` attribute is applicable only if `ha_mode` attribute is