From fcf2b2ba531499f7b242b42938edd12faa492ee8 Mon Sep 17 00:00:00 2001 From: Abhijeet Gaiha Date: Wed, 10 May 2017 07:32:46 +0530 Subject: [PATCH] Trying out fixes for scale set sku tier casing issue #11626 --- .../resource_arm_virtual_machine_scale_set.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/builtin/providers/azurerm/resource_arm_virtual_machine_scale_set.go b/builtin/providers/azurerm/resource_arm_virtual_machine_scale_set.go index a396833cc278..73b89500dbac 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_machine_scale_set.go +++ b/builtin/providers/azurerm/resource_arm_virtual_machine_scale_set.go @@ -6,6 +6,8 @@ import ( "log" "net/http" + "strings" + "github.com/Azure/azure-sdk-for-go/arm/compute" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" @@ -45,14 +47,16 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: ignoreCaseDiffSuppressFunc, }, "tier": { Type: schema.TypeString, Optional: true, - Computed: true, + // Computed: true, + DiffSuppressFunc: ignoreCaseDiffSuppressFunc, }, "capacity": { @@ -771,9 +775,11 @@ func flattenAzureRmVirtualMachineScaleSetSku(sku *compute.Sku) []interface{} { result["capacity"] = *sku.Capacity if *sku.Tier != "" { - result["tier"] = *sku.Tier + result["tier"] = strings.ToLower(*sku.Tier) } + log.Printf("[DEBUG] agaiha sku values, Name:(%s), Capacity:(%d), Tier:(%s)", *sku.Name, *sku.Capacity, *sku.Tier) + return []interface{}{result} }