From a5b85dd788075c4aaa960c6fa7e4441e96223c63 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 9 Sep 2014 14:15:08 -0700 Subject: [PATCH] providers/aws: check if instance is set on eip --- 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 b72dc1235b..d1128a255c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ BUG FIXES: * core: "~" is expanded in `-var-file` flags. [GH-273] * core: Errors with tfvars are shown in console. [GH-269] * providers/aws: Refreshing EIP from pre-0.2 state file won't error. [GH-258] + * providers/aws: Creating EIP without an instance/network won't fail. * providers/digitalocean: Handle situations when resource was destroyed manually. [GH-279] * providers/digitalocean: Fix a couple scenarios where the diff was diff --git a/builtin/providers/aws/resource_aws_eip.go b/builtin/providers/aws/resource_aws_eip.go index b6020938c0..4a3b0ad97e 100644 --- a/builtin/providers/aws/resource_aws_eip.go +++ b/builtin/providers/aws/resource_aws_eip.go @@ -97,7 +97,7 @@ func resourceAwsEipUpdate(d *schema.ResourceData, meta interface{}) error { domain := resourceAwsEipDomain(d) // Only register with an instance if we have one - if v := d.Get("instance"); v != nil { + if v, ok := d.GetOk("instance"); ok { instanceId := v.(string) assocOpts := ec2.AssociateAddress{