DigitalOcean - droplet always being recreated (#7044)

The region returned by the API is always lowercase therefore when you specify a region uppercase in your config file it forces the droplet to be regenerated on every ```terraform apply``` (even when it is not needed).
This commit is contained in:
Benjamin Chelli 2016-06-09 04:23:44 -04:00 committed by Paul Stack
parent 7b273bcd01
commit cc22cef085
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@ func resourceDigitalOceanDroplet() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
StateFunc: func(val interface{}) string {
// DO API V2 region slug is always lowercase
return strings.ToLower(val.(string))
},
},
"size": &schema.Schema{