Normalizes availability_set_id to lowercase to avoid spurious diffs (#6768)

This commit is contained in:
Maxime Bury 2016-05-19 16:44:29 +01:00 committed by Paul Stack
parent 58e1c94335
commit b33bd427e1
1 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"log"
"net/http"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/arm/compute"
@ -69,6 +70,9 @@ func resourceArmVirtualMachine() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
StateFunc: func(id interface{}) string {
return strings.ToLower(id.(string))
},
},
"license_type": &schema.Schema{
@ -480,7 +484,7 @@ func resourceArmVirtualMachineRead(d *schema.ResourceData, meta interface{}) err
}
if resp.Properties.AvailabilitySet != nil {
d.Set("availability_set_id", resp.Properties.AvailabilitySet.ID)
d.Set("availability_set_id", strings.ToLower(*resp.Properties.AvailabilitySet.ID))
}
d.Set("vm_size", resp.Properties.HardwareProfile.VMSize)