diff --git a/CHANGELOG.md b/CHANGELOG.md index d1128a255..66560bd13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ BUG FIXES: * 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/aws: Refreshing EIP manually deleted works. * 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 4a3b0ad97..71732d067 100644 --- a/builtin/providers/aws/resource_aws_eip.go +++ b/builtin/providers/aws/resource_aws_eip.go @@ -163,6 +163,11 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { describeAddresses, err := ec2conn.Addresses(publicIps, assocIds, nil) if err != nil { + if ec2err, ok := err.(*ec2.Error); ok && ec2err.Code == "InvalidAllocationID.NotFound" { + d.SetId("") + return nil + } + return fmt.Errorf("Error retrieving EIP: %s", err) }