From ab5e07a1f946110e6f27aea40b68f79751ab7a9a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 8 Sep 2014 20:24:43 -0700 Subject: [PATCH] providers/aws: use GetOk to check for value [GH-258] --- CHANGELOG.md | 1 + builtin/providers/aws/resource_aws_eip.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50387c67e..22ba3925d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ IMPROVEMENTS: BUG FIXES: * core: Fix certain syntax of configuration that could cause hang. [GH-261] + * providers/aws: Refreshing EIP from pre-0.2 state file won't error. [GH-258] * providers/google: Attaching a disk source (not an image) works properly. [GH-254] diff --git a/builtin/providers/aws/resource_aws_eip.go b/builtin/providers/aws/resource_aws_eip.go index e27f639a6..b6020938c 100644 --- a/builtin/providers/aws/resource_aws_eip.go +++ b/builtin/providers/aws/resource_aws_eip.go @@ -185,7 +185,7 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { } func resourceAwsEipDomain(d *schema.ResourceData) string { - if v := d.Get("domain"); v != nil { + if v, ok := d.GetOk("domain"); ok { return v.(string) } else if strings.Contains(d.Id(), "eipalloc") { // We have to do this for backwards compatibility since TF 0.1