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:
parent
697828f81f
commit
9c095d66e1
|
@ -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{})
|
||||
|
|
|
@ -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{})
|
||||
|
|
Loading…
Reference in New Issue