providers/aws: check for non-exist on refresh
This commit is contained in:
parent
a5b85dd788
commit
57f287c06d
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue