Skip to content

Commit

Permalink
fixing dns_settings read attribute and removing last trace of vm_ pro…
Browse files Browse the repository at this point in the history
…perties
  • Loading branch information
djsly committed May 24, 2018
1 parent b4e2c54 commit 40b157c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 13 additions & 0 deletions azurerm/resource_arm_virtual_machine_scale_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,19 @@ func flattenAzureRmVirtualMachineScaleSetNetworkProfile(profile *compute.Virtual
s["network_security_group_id"] = *v.ID
}

if netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.DNSSettings != nil {
dnsSettings := make(map[string]interface{})
dnsServers := make([]interface{}, 0)
if netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.DNSSettings.DNSServers != nil {
for _, dnsServer := range *netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.DNSSettings.DNSServers {
dnsServers = append(dnsServers, dnsServer)
}
dnsSettings["dns_servers"] = dnsServers
}

s["dns_settings"] = dnsSettings
}

if netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.IPConfigurations != nil {
ipConfigs := make([]map[string]interface{}, 0, len(*netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.IPConfigurations))
for _, ipConfig := range *netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.IPConfigurations {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/resource_arm_virtual_machine_scale_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ func TestAccAzureRMVirtualMachineScaleSet_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMVirtualMachineScaleSetExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "vm_hostnames"),
resource.TestCheckResourceAttrSet(resourceName, "vm_statuses"),
resource.TestCheckResourceAttrSet(resourceName, "vm_primary_private_ip_addresses"),
// testing default scaleset values
testCheckAzureRMVirtualMachineScaleSetSinglePlacementGroup(resourceName, true),
resource.TestCheckResourceAttr(resourceName, "ip_forwarding", "false"),
Expand Down

0 comments on commit 40b157c

Please sign in to comment.