terraform/builtin/providers
Paul Hinze 473b03ccae providers/aws: fix source_dest_check on instance creation
The `SourceDestCheck` attribute can only be changed via
`ModifyInstance`, so the AWS instance resource's `Create` function calls
out to `Update` before it returns to take care of applying
`source_dest_check` properly.

The `Update` function originally guarded against unnecessary API calls
with `GetOk`, which worked fine until #993 when we changed the `GetOk`
semantics to no longer distinguish between "configured and zero-value"
and "not configured".

I attempted in #1003 to fix this by switching to `HasChange` for the
guard, but this does not work in the `Create` case.

I played around with a few different ideas, none of which worked:

(a) Setting `Default: true` on `source_dest_check' has no effect

(b) Setting `Computed: true` on `source_dest_check' and adding a `d.Set`
    call in the `Read` function (which will initially set the value to `true`
    after instance creation). I really thought I could get this to work,
    but it results in the following:

```go
d.Get('source_dest_check')       // true
d.HasChange('source_dest_check') // false
d.GetChange('source_dest_check') // old: false, new: false
```

I couldn't figure out a way of coherently dealing with that result, so I
ended up throwing up my hands and giving up on the guard altogether.
We'll call `ModifyInstance` more than we have to, but this at least
yields expected behavior for both Creates and Updates.

Fixes #1020
2015-02-21 14:26:46 -06:00
..
atlas Move duplicated envDefaultFunc out of each provider and into Schema. 2015-01-16 17:25:39 +00:00
aws providers/aws: fix source_dest_check on instance creation 2015-02-21 14:26:46 -06:00
cloudflare Move duplicated envDefaultFunc out of each provider and into Schema. 2015-01-16 17:25:39 +00:00
cloudstack Move duplicated envDefaultFunc out of each provider and into Schema. 2015-01-16 17:25:39 +00:00
consul Fix comment in consul provider to not mention digitalocean 2015-01-22 12:45:55 -08:00
digitalocean providers/digitalocean: style 2015-02-18 15:14:50 -08:00
dnsimple Move duplicated envDefaultFunc out of each provider and into Schema. 2015-01-16 17:25:39 +00:00
google fmt 2015-02-20 10:22:26 -08:00
heroku fmt 2015-02-20 10:22:26 -08:00
mailgun providers/mailgun: fix sending/receiving records 2015-02-18 17:18:19 -06:00
null providers/null: null provider 2014-10-04 16:42:43 -07:00