azurerm: fix vault_certificates in vm/scale_set (#7681)

When setting the certificate_url and certificate_store values in
os_profile_secrets / vault_certificates for a Windows VM in AzureRM, I
was getting the following error:

```
[DEBUG] Error setting Virtual Machine Storage OS Profile Secrets:
&errors.errorString{s:"Invalid address to set:
[]string{\"os_profile_secrets\", \"0\", \"vault_certificates\"}"}
```

This seems to resolve the issue.
This commit is contained in:
Steven Eschinger 2016-07-18 05:20:18 -04:00 committed by Paul Stack
parent 697828f81f
commit 9c095d66e1
2 changed files with 4 additions and 4 deletions

View File

@ -339,7 +339,7 @@ func resourceArmVirtualMachine() *schema.Resource {
},
"vault_certificates": {
Type: schema.TypeSet,
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
@ -908,7 +908,7 @@ func expandAzureRmVirtualMachineOsProfileSecrets(d *schema.ResourceData) *[]comp
}
if v := config["vault_certificates"]; v != nil {
certsConfig := v.(*schema.Set).List()
certsConfig := v.([]interface{})
certs := make([]compute.VaultCertificate, 0, len(certsConfig))
for _, certConfig := range certsConfig {
config := certConfig.(map[string]interface{})

View File

@ -111,7 +111,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource {
},
"vault_certificates": &schema.Schema{
Type: schema.TypeSet,
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
@ -1063,7 +1063,7 @@ func expandAzureRmVirtualMachineScaleSetOsProfileSecrets(d *schema.ResourceData)
}
if v := config["vault_certificates"]; v != nil {
certsConfig := v.(*schema.Set).List()
certsConfig := v.([]interface{})
certs := make([]compute.VaultCertificate, 0, len(certsConfig))
for _, certConfig := range certsConfig {
config := certConfig.(map[string]interface{})