Merge pull request #2544 from hashicorp/b-vpc-peer-failed

providers/aws: vpc peering failed == deleted [GH-2322]
This commit is contained in:
Mitchell Hashimoto 2015-06-29 10:35:15 -07:00
commit 4b5b6b6942
1 changed files with 8 additions and 0 deletions

View File

@ -101,6 +101,14 @@ func resourceAwsVPCPeeringRead(d *schema.ResourceData, meta interface{}) error {
pc := pcRaw.(*ec2.VPCPeeringConnection)
// The failed status is a status that we can assume just means the
// connection is gone. Destruction isn't allowed, and it eventually
// just "falls off" the console. See GH-2322
if *pc.Status.Code == "failed" {
d.SetId("")
return nil
}
d.Set("accept_status", *pc.Status.Code)
d.Set("peer_owner_id", pc.AccepterVPCInfo.OwnerID)
d.Set("peer_vpc_id", pc.AccepterVPCInfo.VPCID)