From 9ac39a3edf15863be941635ee756f008b1ece51e Mon Sep 17 00:00:00 2001 From: stack72 Date: Fri, 18 Sep 2015 19:42:37 +0100 Subject: [PATCH] Enforcing lowercase on the DO Size. This is used for the sizeslug property of API calls - according to their [docs](https://developers.digitalocean.com/documentation/v1/sizes/) this always looks to be lowercase on the slug. I cannot find any definite answer to this question though --- .../providers/digitalocean/resource_digitalocean_droplet.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/digitalocean/resource_digitalocean_droplet.go b/builtin/providers/digitalocean/resource_digitalocean_droplet.go index 88c0c6d07a..c14b248c64 100644 --- a/builtin/providers/digitalocean/resource_digitalocean_droplet.go +++ b/builtin/providers/digitalocean/resource_digitalocean_droplet.go @@ -39,6 +39,10 @@ func resourceDigitalOceanDroplet() *schema.Resource { "size": &schema.Schema{ Type: schema.TypeString, Required: true, + StateFunc: func(val interface{}) string { + // DO API V2 size slug is always lowercase + return strings.ToLower(val.(string)) + }, }, "status": &schema.Schema{