Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network related fixes #90

Merged
merged 3 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions acc-testcases/resources/network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 2 additions & 1 deletion examples/resources/hpegl_vmaas_network/nsx_t_segment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 0 additions & 3 deletions internal/cmp/resource_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down
3 changes: 3 additions & 0 deletions templates/resources/vmaas_network.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions templates/resources/vmaas_router.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down