providers/aws: check for non-exist on refresh

This commit is contained in:
Mitchell Hashimoto 2014-09-09 14:15:33 -07:00
parent a5b85dd788
commit 57f287c06d
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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)
}