2015-12-08 23:30:12 +01:00
|
|
|
package azurerm
|
|
|
|
|
2016-06-01 23:36:41 +02:00
|
|
|
import (
|
2017-06-01 18:40:30 +02:00
|
|
|
"bytes"
|
2016-06-01 23:36:41 +02:00
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/Azure/azure-sdk-for-go/arm/network"
|
|
|
|
"github.com/hashicorp/terraform/helper/hashcode"
|
|
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
|
|
)
|
|
|
|
|
|
|
|
func resourceArmVirtualNetwork() *schema.Resource {
|
|
|
|
return &schema.Resource{
|
|
|
|
Create: resourceArmVirtualNetworkCreate,
|
|
|
|
Read: resourceArmVirtualNetworkRead,
|
|
|
|
Update: resourceArmVirtualNetworkCreate,
|
|
|
|
Delete: resourceArmVirtualNetworkDelete,
|
2016-07-13 13:32:34 +02:00
|
|
|
Importer: &schema.ResourceImporter{
|
|
|
|
State: schema.ImportStatePassthrough,
|
|
|
|
},
|
2016-06-01 23:36:41 +02:00
|
|
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
"name": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Required: true,
|
|
|
|
ForceNew: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
"address_space": {
|
|
|
|
Type: schema.TypeList,
|
|
|
|
Required: true,
|
|
|
|
Elem: &schema.Schema{
|
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
"dns_servers": {
|
|
|
|
Type: schema.TypeList,
|
|
|
|
Optional: true,
|
|
|
|
Elem: &schema.Schema{
|
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
"subnet": {
|
|
|
|
Type: schema.TypeSet,
|
|
|
|
Optional: true,
|
|
|
|
Computed: true,
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
"name": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Required: true,
|
|
|
|
},
|
|
|
|
"address_prefix": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Required: true,
|
|
|
|
},
|
|
|
|
"security_group": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Set: resourceAzureSubnetHash,
|
|
|
|
},
|
|
|
|
|
2016-11-29 16:54:00 +01:00
|
|
|
"location": locationSchema(),
|
2016-06-01 23:36:41 +02:00
|
|
|
|
|
|
|
"resource_group_name": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Required: true,
|
|
|
|
ForceNew: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
"tags": tagsSchema(),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func resourceArmVirtualNetworkCreate(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
client := meta.(*ArmClient)
|
|
|
|
vnetClient := client.vnetClient
|
|
|
|
|
|
|
|
log.Printf("[INFO] preparing arguments for Azure ARM virtual network creation.")
|
|
|
|
|
|
|
|
name := d.Get("name").(string)
|
|
|
|
location := d.Get("location").(string)
|
|
|
|
resGroup := d.Get("resource_group_name").(string)
|
|
|
|
tags := d.Get("tags").(map[string]interface{})
|
2017-06-01 18:40:30 +02:00
|
|
|
vnetProperties, vnetPropsErr := getVirtualNetworkProperties(d, meta)
|
|
|
|
if vnetPropsErr != nil {
|
|
|
|
return vnetPropsErr
|
|
|
|
}
|
2016-06-01 23:36:41 +02:00
|
|
|
|
|
|
|
vnet := network.VirtualNetwork{
|
2016-12-06 09:39:47 +01:00
|
|
|
Name: &name,
|
|
|
|
Location: &location,
|
2017-06-01 18:40:30 +02:00
|
|
|
VirtualNetworkPropertiesFormat: vnetProperties,
|
2016-12-06 09:39:47 +01:00
|
|
|
Tags: expandTags(tags),
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
|
|
|
|
2017-04-13 16:26:51 +02:00
|
|
|
networkSecurityGroupNames := make([]string, 0)
|
|
|
|
for _, subnet := range *vnet.VirtualNetworkPropertiesFormat.Subnets {
|
|
|
|
if subnet.NetworkSecurityGroup != nil {
|
2017-04-13 16:28:13 +02:00
|
|
|
nsgName, err := parseNetworkSecurityGroupName(*subnet.NetworkSecurityGroup.ID)
|
2017-04-13 16:26:51 +02:00
|
|
|
if err != nil {
|
2017-04-13 16:28:13 +02:00
|
|
|
return err
|
2017-04-13 16:26:51 +02:00
|
|
|
}
|
2017-04-13 16:28:13 +02:00
|
|
|
|
2017-04-13 16:26:51 +02:00
|
|
|
networkSecurityGroupNames = append(networkSecurityGroupNames, nsgName)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-10 14:08:45 +02:00
|
|
|
azureRMLockMultiple(&networkSecurityGroupNames)
|
|
|
|
defer azureRMUnlockMultiple(&networkSecurityGroupNames)
|
2017-04-13 16:26:51 +02:00
|
|
|
|
2017-06-01 11:18:22 +02:00
|
|
|
_, error := vnetClient.CreateOrUpdate(resGroup, name, vnet, make(chan struct{}))
|
|
|
|
err := <-error
|
2016-06-01 23:36:41 +02:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
read, err := vnetClient.Get(resGroup, name, "")
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if read.ID == nil {
|
|
|
|
return fmt.Errorf("Cannot read Virtual Network %s (resource group %s) ID", name, resGroup)
|
|
|
|
}
|
|
|
|
|
|
|
|
d.SetId(*read.ID)
|
|
|
|
|
|
|
|
return resourceArmVirtualNetworkRead(d, meta)
|
|
|
|
}
|
|
|
|
|
|
|
|
func resourceArmVirtualNetworkRead(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
vnetClient := meta.(*ArmClient).vnetClient
|
|
|
|
|
|
|
|
id, err := parseAzureResourceID(d.Id())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
resGroup := id.ResourceGroup
|
|
|
|
name := id.Path["virtualNetworks"]
|
|
|
|
|
|
|
|
resp, err := vnetClient.Get(resGroup, name, "")
|
provider/azurerm: Reordering the checks after an Azure API Get
We are receiving suggestions of a panic as follows:
```
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic: runtime error: invalid memory address or nil pointer dereference
2016/09/01 07:21:55 [DEBUG] plugin: terraform: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa3170f]
2016/09/01 07:21:55 [DEBUG] plugin: terraform:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: goroutine 114 [running]:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic(0x27f4e60, 0xc4200100e0)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: /opt/go/src/runtime/panic.go:500 +0x1a1
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineRead(0xc4206d8060, 0x2995620, 0xc4204d0000, 0x0, 0x17)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine.go:488 +0x1ff
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc420017a40, 0xc42040c780, 0x2995620, 0xc4204d0000, 0xc42019c990, 0x1, 0x0)
```
This is because the code is as follows:
```
resp, err := client.Get(resGroup, vnetName, name)
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}
if err != nil {
return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
```
When a request throws an error, the response object isn't valid. Therefore, we need to flip that code to check the error first
```
resp, err := client.Get(resGroup, vnetName, name)
if err != nil {
return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}
```
2016-09-01 16:31:42 +02:00
|
|
|
if err != nil {
|
2016-09-30 18:57:59 +02:00
|
|
|
if resp.StatusCode == http.StatusNotFound {
|
|
|
|
d.SetId("")
|
|
|
|
return nil
|
|
|
|
}
|
provider/azurerm: Reordering the checks after an Azure API Get
We are receiving suggestions of a panic as follows:
```
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic: runtime error: invalid memory address or nil pointer dereference
2016/09/01 07:21:55 [DEBUG] plugin: terraform: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa3170f]
2016/09/01 07:21:55 [DEBUG] plugin: terraform:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: goroutine 114 [running]:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic(0x27f4e60, 0xc4200100e0)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: /opt/go/src/runtime/panic.go:500 +0x1a1
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineRead(0xc4206d8060, 0x2995620, 0xc4204d0000, 0x0, 0x17)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine.go:488 +0x1ff
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc420017a40, 0xc42040c780, 0x2995620, 0xc4204d0000, 0xc42019c990, 0x1, 0x0)
```
This is because the code is as follows:
```
resp, err := client.Get(resGroup, vnetName, name)
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}
if err != nil {
return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
```
When a request throws an error, the response object isn't valid. Therefore, we need to flip that code to check the error first
```
resp, err := client.Get(resGroup, vnetName, name)
if err != nil {
return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}
```
2016-09-01 16:31:42 +02:00
|
|
|
return fmt.Errorf("Error making Read request on Azure virtual network %s: %s", name, err)
|
|
|
|
}
|
2016-09-30 18:57:59 +02:00
|
|
|
|
2016-12-06 09:39:47 +01:00
|
|
|
vnet := *resp.VirtualNetworkPropertiesFormat
|
2016-06-01 23:36:41 +02:00
|
|
|
|
|
|
|
// update appropriate values
|
2016-09-27 18:45:43 +02:00
|
|
|
d.Set("resource_group_name", resGroup)
|
2016-07-13 13:32:34 +02:00
|
|
|
d.Set("name", resp.Name)
|
|
|
|
d.Set("location", resp.Location)
|
2016-06-01 23:36:41 +02:00
|
|
|
d.Set("address_space", vnet.AddressSpace.AddressPrefixes)
|
|
|
|
|
|
|
|
subnets := &schema.Set{
|
|
|
|
F: resourceAzureSubnetHash,
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, subnet := range *vnet.Subnets {
|
|
|
|
s := map[string]interface{}{}
|
|
|
|
|
|
|
|
s["name"] = *subnet.Name
|
2016-12-06 09:39:47 +01:00
|
|
|
s["address_prefix"] = *subnet.SubnetPropertiesFormat.AddressPrefix
|
|
|
|
if subnet.SubnetPropertiesFormat.NetworkSecurityGroup != nil {
|
|
|
|
s["security_group"] = *subnet.SubnetPropertiesFormat.NetworkSecurityGroup.ID
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
subnets.Add(s)
|
|
|
|
}
|
|
|
|
d.Set("subnet", subnets)
|
|
|
|
|
2016-10-31 18:03:12 +01:00
|
|
|
if vnet.DhcpOptions != nil && vnet.DhcpOptions.DNSServers != nil {
|
|
|
|
dnses := []string{}
|
|
|
|
for _, dns := range *vnet.DhcpOptions.DNSServers {
|
|
|
|
dnses = append(dnses, dns)
|
|
|
|
}
|
|
|
|
d.Set("dns_servers", dnses)
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
flattenAndSetTags(d, resp.Tags)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func resourceArmVirtualNetworkDelete(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
vnetClient := meta.(*ArmClient).vnetClient
|
|
|
|
|
|
|
|
id, err := parseAzureResourceID(d.Id())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
resGroup := id.ResourceGroup
|
|
|
|
name := id.Path["virtualNetworks"]
|
|
|
|
|
2017-04-13 16:28:13 +02:00
|
|
|
nsgNames, err := expandAzureRmVirtualNetworkVirtualNetworkSecurityGroupNames(d)
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("[ERROR] Error parsing Network Security Group ID's: %+v", err)
|
|
|
|
}
|
|
|
|
|
2017-05-10 14:08:45 +02:00
|
|
|
azureRMLockMultiple(&nsgNames)
|
|
|
|
defer azureRMUnlockMultiple(&nsgNames)
|
2017-04-13 16:26:51 +02:00
|
|
|
|
2017-06-01 11:18:22 +02:00
|
|
|
_, error := vnetClient.Delete(resGroup, name, make(chan struct{}))
|
|
|
|
err = <-error
|
2016-06-01 23:36:41 +02:00
|
|
|
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2017-06-01 18:40:30 +02:00
|
|
|
func getVirtualNetworkProperties(d *schema.ResourceData, meta interface{}) (*network.VirtualNetworkPropertiesFormat, error) {
|
2016-06-01 23:36:41 +02:00
|
|
|
// first; get address space prefixes:
|
|
|
|
prefixes := []string{}
|
|
|
|
for _, prefix := range d.Get("address_space").([]interface{}) {
|
|
|
|
prefixes = append(prefixes, prefix.(string))
|
|
|
|
}
|
|
|
|
|
|
|
|
// then; the dns servers:
|
|
|
|
dnses := []string{}
|
|
|
|
for _, dns := range d.Get("dns_servers").([]interface{}) {
|
|
|
|
dnses = append(dnses, dns.(string))
|
|
|
|
}
|
|
|
|
|
|
|
|
// then; the subnets:
|
|
|
|
subnets := []network.Subnet{}
|
|
|
|
if subs := d.Get("subnet").(*schema.Set); subs.Len() > 0 {
|
|
|
|
for _, subnet := range subs.List() {
|
|
|
|
subnet := subnet.(map[string]interface{})
|
|
|
|
|
|
|
|
name := subnet["name"].(string)
|
2017-06-01 18:40:30 +02:00
|
|
|
log.Printf("[INFO] setting subnets inside vNet, processing %q", name)
|
|
|
|
//since subnets can also be created outside of vNet definition (as root objects)
|
|
|
|
// do a GET on subnet properties from the server before setting them
|
|
|
|
resGroup := d.Get("resource_group_name").(string)
|
|
|
|
vnetName := d.Get("name").(string)
|
|
|
|
subnetObj, err := getExistingSubnet(resGroup, vnetName, name, meta)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
log.Printf("[INFO] Completed GET of Subnet props ")
|
|
|
|
|
2016-06-01 23:36:41 +02:00
|
|
|
prefix := subnet["address_prefix"].(string)
|
|
|
|
secGroup := subnet["security_group"].(string)
|
|
|
|
|
2017-06-01 18:40:30 +02:00
|
|
|
//set the props from config and leave the rest intact
|
2016-06-01 23:36:41 +02:00
|
|
|
subnetObj.Name = &name
|
2017-06-01 18:40:30 +02:00
|
|
|
if subnetObj.SubnetPropertiesFormat == nil {
|
|
|
|
subnetObj.SubnetPropertiesFormat = &network.SubnetPropertiesFormat{}
|
|
|
|
}
|
|
|
|
|
2016-12-06 09:39:47 +01:00
|
|
|
subnetObj.SubnetPropertiesFormat.AddressPrefix = &prefix
|
2016-06-01 23:36:41 +02:00
|
|
|
|
|
|
|
if secGroup != "" {
|
2016-12-06 09:39:47 +01:00
|
|
|
subnetObj.SubnetPropertiesFormat.NetworkSecurityGroup = &network.SecurityGroup{
|
2016-06-01 23:36:41 +02:00
|
|
|
ID: &secGroup,
|
|
|
|
}
|
2017-06-01 18:40:30 +02:00
|
|
|
} else {
|
|
|
|
subnetObj.SubnetPropertiesFormat.NetworkSecurityGroup = nil
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
|
|
|
|
2017-06-01 18:40:30 +02:00
|
|
|
subnets = append(subnets, *subnetObj)
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-01 18:40:30 +02:00
|
|
|
properties := &network.VirtualNetworkPropertiesFormat{
|
2016-06-01 23:36:41 +02:00
|
|
|
AddressSpace: &network.AddressSpace{
|
|
|
|
AddressPrefixes: &prefixes,
|
|
|
|
},
|
|
|
|
DhcpOptions: &network.DhcpOptions{
|
|
|
|
DNSServers: &dnses,
|
|
|
|
},
|
|
|
|
Subnets: &subnets,
|
|
|
|
}
|
2017-06-01 18:40:30 +02:00
|
|
|
// finally; return the struct:
|
|
|
|
return properties, nil
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func resourceAzureSubnetHash(v interface{}) int {
|
2017-06-01 18:40:30 +02:00
|
|
|
var buf bytes.Buffer
|
2016-06-01 23:36:41 +02:00
|
|
|
m := v.(map[string]interface{})
|
2017-06-01 18:40:30 +02:00
|
|
|
buf.WriteString(fmt.Sprintf("%s", m["name"].(string)))
|
|
|
|
buf.WriteString(fmt.Sprintf("%s", m["address_prefix"].(string)))
|
|
|
|
if v, ok := m["security_group"]; ok {
|
|
|
|
buf.WriteString(v.(string))
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
2017-06-01 18:40:30 +02:00
|
|
|
return hashcode.String(buf.String())
|
|
|
|
}
|
|
|
|
|
|
|
|
func getExistingSubnet(resGroup string, vnetName string, subnetName string, meta interface{}) (*network.Subnet, error) {
|
|
|
|
//attempt to retrieve existing subnet from the server
|
|
|
|
existingSubnet := network.Subnet{}
|
|
|
|
subnetClient := meta.(*ArmClient).subnetClient
|
|
|
|
resp, err := subnetClient.Get(resGroup, vnetName, subnetName, "")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if resp.StatusCode == http.StatusNotFound {
|
|
|
|
return &existingSubnet, nil
|
|
|
|
}
|
|
|
|
//raise an error if there was an issue other than 404 in getting subnet properties
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
existingSubnet.SubnetPropertiesFormat = &network.SubnetPropertiesFormat{}
|
|
|
|
existingSubnet.SubnetPropertiesFormat.AddressPrefix = resp.SubnetPropertiesFormat.AddressPrefix
|
|
|
|
|
|
|
|
if resp.SubnetPropertiesFormat.NetworkSecurityGroup != nil {
|
|
|
|
existingSubnet.SubnetPropertiesFormat.NetworkSecurityGroup = resp.SubnetPropertiesFormat.NetworkSecurityGroup
|
|
|
|
}
|
|
|
|
|
|
|
|
if resp.SubnetPropertiesFormat.RouteTable != nil {
|
|
|
|
existingSubnet.SubnetPropertiesFormat.RouteTable = resp.SubnetPropertiesFormat.RouteTable
|
|
|
|
}
|
|
|
|
|
|
|
|
if resp.SubnetPropertiesFormat.IPConfigurations != nil {
|
|
|
|
ips := make([]string, 0, len(*resp.SubnetPropertiesFormat.IPConfigurations))
|
|
|
|
for _, ip := range *resp.SubnetPropertiesFormat.IPConfigurations {
|
|
|
|
ips = append(ips, *ip.ID)
|
|
|
|
}
|
|
|
|
|
|
|
|
existingSubnet.SubnetPropertiesFormat.IPConfigurations = resp.SubnetPropertiesFormat.IPConfigurations
|
|
|
|
}
|
|
|
|
|
|
|
|
return &existingSubnet, nil
|
2016-06-01 23:36:41 +02:00
|
|
|
}
|
2017-04-13 16:28:13 +02:00
|
|
|
|
|
|
|
func expandAzureRmVirtualNetworkVirtualNetworkSecurityGroupNames(d *schema.ResourceData) ([]string, error) {
|
|
|
|
nsgNames := make([]string, 0)
|
|
|
|
|
|
|
|
if v, ok := d.GetOk("subnet"); ok {
|
|
|
|
subnets := v.(*schema.Set).List()
|
|
|
|
for _, subnet := range subnets {
|
2017-04-18 17:20:29 +02:00
|
|
|
subnet, ok := subnet.(map[string]interface{})
|
|
|
|
if !ok {
|
|
|
|
return nil, fmt.Errorf("[ERROR] Subnet should be a Hash - was '%+v'", subnet)
|
|
|
|
}
|
2017-04-13 16:28:13 +02:00
|
|
|
|
|
|
|
networkSecurityGroupId := subnet["security_group"].(string)
|
|
|
|
if networkSecurityGroupId != "" {
|
|
|
|
nsgName, err := parseNetworkSecurityGroupName(networkSecurityGroupId)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
nsgNames = append(nsgNames, nsgName)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsgNames, nil
|
|
|
|
}
|