Skip to content

Commit

Permalink
Trying out fixes for scale set sku tier casing issue hashicorp#11626
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijeet Gaiha committed May 24, 2017
1 parent cbcdd29 commit 2b1f6e2
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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}
}

Expand Down

0 comments on commit 2b1f6e2

Please sign in to comment.