diff --git a/examples/schema_site_vrf_region/main.tf b/examples/schema_site_vrf_region/main.tf index f8dd218f..3fcc5a15 100644 --- a/examples/schema_site_vrf_region/main.tf +++ b/examples/schema_site_vrf_region/main.tf @@ -14,23 +14,24 @@ provider "mso" { } resource "mso_schema_site_vrf_region" "vrfRegion" { - schema_id = "5efd6ea60f00005b0ebbd643" - template_name = "Template1" - site_id = "5efeb3c4190000cc12d05376" - vrf_name = "Myvrf" - region_name = "us-east-1" - vpn_gateway = true + schema_id = "5efd6ea60f00005b0ebbd643" + template_name = "Template1" + site_id = "5efeb3c4190000cc12d05376" + vrf_name = "Myvrf" + region_name = "us-east-1" + vpn_gateway = true hub_network_enable = true hub_network = { - name = "hub-fualt" + name = "hub-fualt" tenant_name = "infra" } cidr { cidr_ip = "2.2.2.2/10" primary = true subnet { - ip = "1.20.30.4" - zone = "us-east-1b" + ip = "1.20.30.4" + name = "subnet1" + zone = "us-east-1b" usage = "gateway" } } diff --git a/mso/datasource_mso_schema_site_vrf_region.go b/mso/datasource_mso_schema_site_vrf_region.go index 80faeb80..c7d7b79c 100644 --- a/mso/datasource_mso_schema_site_vrf_region.go +++ b/mso/datasource_mso_schema_site_vrf_region.go @@ -107,6 +107,12 @@ func dataSourceMSOSchemaSiteVrfRegion() *schema.Resource { Computed: true, ValidateFunc: validation.StringLenBetween(1, 1000), }, + "name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringLenBetween(1, 1000), + }, "zone": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -223,6 +229,9 @@ func dataSourceMSOSchemaSiteVrfRegionRead(d *schema.ResourceData, m interface{}) subnetMap := make(map[string]interface{}) subnetMap["ip"] = subnet["ip"] + if subnet["name"] != nil { + subnetMap["name"] = subnet["name"] + } if subnet["zone"] != nil { subnetMap["zone"] = subnet["zone"] } diff --git a/mso/resource_mso_schema_site_vrf_region.go b/mso/resource_mso_schema_site_vrf_region.go index 5dfcb822..e58ab93a 100644 --- a/mso/resource_mso_schema_site_vrf_region.go +++ b/mso/resource_mso_schema_site_vrf_region.go @@ -108,9 +108,16 @@ func resourceMSOSchemaSiteVrfRegion() *schema.Resource { Required: true, ValidateFunc: validation.StringLenBetween(1, 1000), }, + "name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringLenBetween(1, 1000), + }, "zone": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: validation.StringLenBetween(1, 1000), }, "usage": &schema.Schema{ @@ -223,6 +230,9 @@ func resourceMSOSchemaSiteVrfRegionImport(d *schema.ResourceData, m interface{}) subnetMap := make(map[string]interface{}) subnetMap["ip"] = subnet["ip"] + if subnet["name"] != nil { + subnetMap["name"] = subnet["name"] + } if subnet["zone"] != nil { subnetMap["zone"] = subnet["zone"] } @@ -309,6 +319,9 @@ func resourceMSOSchemaSiteVrfRegionCreate(d *schema.ResourceData, m interface{}) subnetMap := make(map[string]interface{}) subnetMap["ip"] = subnet["ip"] + if subnet["name"] != nil { + subnetMap["name"] = subnet["name"] + } if subnet["zone"] != nil { subnetMap["zone"] = subnet["zone"] } @@ -389,6 +402,9 @@ func resourceMSOSchemaSiteVrfRegionUpdate(d *schema.ResourceData, m interface{}) subnetMap := make(map[string]interface{}) subnetMap["ip"] = subnet["ip"] + if subnet["name"] != nil { + subnetMap["name"] = subnet["name"] + } if subnet["zone"] != nil { subnetMap["zone"] = subnet["zone"] } @@ -508,6 +524,9 @@ func resourceMSOSchemaSiteVrfRegionRead(d *schema.ResourceData, m interface{}) e subnetMap := make(map[string]interface{}) subnetMap["ip"] = subnet["ip"] + if subnet["name"] != nil { + subnetMap["name"] = subnet["name"] + } if subnet["zone"] != nil { subnetMap["zone"] = subnet["zone"] } diff --git a/website/docs/d/schema_site_vrf_region.html.markdown b/website/docs/d/schema_site_vrf_region.html.markdown index 4272cf5b..c5bcdfd5 100644 --- a/website/docs/d/schema_site_vrf_region.html.markdown +++ b/website/docs/d/schema_site_vrf_region.html.markdown @@ -35,11 +35,12 @@ data "mso_schema_site_vrf_region" "vrfRegion" { * `template_name` - (Optional) Template where Vrf Region to be created. * `cidr` - (Optional) CIDR to set into region -* `cidr.cidr_ip` - (Optional) Ip address for cidr. -* `cidr.primary` - (Optional) primary flag to set above ip as primary for cidr. Only one ip must be set as primary. +* `cidr.cidr_ip` - (Optional) IP address for CIDR. +* `cidr.primary` - (Optional) primary flag to set CIDR as primary. Only one CIDR can be set as primary. -* `cidr.subnet` - (Optional) subnets to associate with cidr. -* `cidr.subnet.ip` - (Optional) ip address for subnet. +* `cidr.subnet` - (Optional) subnets to associate with CIDR. +* `cidr.subnet.ip` - (Optional) IP address for the subnet. +* `cidr.subnet.name` - (Optional) Name for the subnet. * `cidr.subnet.zone` - (Optional) zone for the subnet. * `cidr.subnet.usage` - (Optional) usage information of particular subnet. diff --git a/website/docs/r/schema_site_vrf_region.html.markdown b/website/docs/r/schema_site_vrf_region.html.markdown index 27a582ac..604d43c8 100644 --- a/website/docs/r/schema_site_vrf_region.html.markdown +++ b/website/docs/r/schema_site_vrf_region.html.markdown @@ -31,6 +31,7 @@ resource "mso_schema_site_vrf_region" "vrfRegion" { primary = true subnet { ip = "1.20.30.4" + name = "subnet1" zone = "us-east-1b" usage = "sdfkhsdkf" } @@ -48,11 +49,12 @@ resource "mso_schema_site_vrf_region" "vrfRegion" { * `template_name` - (Required) Template where Vrf Region to be created. * `cidr` - (Required) CIDR to set into region -* `cidr.cidr_ip` - (Required) Ip address for cidr. -* `cidr.primary` - (Required) Primary flag to set above ip as primary for cidr. Only one ip must be set as primary. +* `cidr.cidr_ip` - (Required) IP address for CIDR. +* `cidr.primary` - (Required) Primary flag to set CIDR as primary. Only one CIDR can be set as primary. -* `cidr.subnet` - (Required) Subnets to associate with cidr. -* `cidr.subnet.ip` - (Required) Ip address for subnet. +* `cidr.subnet` - (Required) Subnets to associate with CIDR. +* `cidr.subnet.ip` - (Required) IP address for the subnet. +* `cidr.subnet.name` - (Required) Name for the subnet. * `cidr.subnet.zone` - (Optional) The name of the availability zone for the subnet. This argument is required for AWS sites. * `cidr.subnet.usage` - (Optional) Usage information of particular subnet.