Skip to content

Commit

Permalink
Splitting the SKU assignment out
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Sep 5, 2017
1 parent 5ebf58b commit a25d57b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions azurerm/resource_arm_postgresql_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ func resourceArmPostgreSQLServerRead(d *schema.ResourceData, meta interface{}) e
d.Set("version", string(resp.Version))
d.Set("storage_mb", int(*resp.StorageMB))
d.Set("ssl_enforcement", string(resp.SslEnforcement))
d.Set("sku", flattenPostgreSQLServerSku(resp.Sku))

flattenAndSetAzureRmPostgreSQLServerSku(d, resp.Sku)
flattenAndSetTags(d, resp.Tags)

// Computed
Expand Down Expand Up @@ -295,13 +295,13 @@ func expandAzureRmPostgreSQLServerSku(d *schema.ResourceData, storageMB int) *po
}
}

func flattenAndSetAzureRmPostgreSQLServerSku(d *schema.ResourceData, resp *postgresql.Sku) {
func flattenPostgreSQLServerSku(d *schema.ResourceData, resp *postgresql.Sku) []interface{} {
values := map[string]interface{}{}

values["name"] = *resp.Name
values["capacity"] = int(*resp.Capacity)
values["tier"] = string(resp.Tier)

sku := []interface{}{values}
d.Set("sku", sku)
return sku
}

0 comments on commit a25d57b

Please sign in to comment.