Skip to content

Commit

Permalink
Merge pull request #2544 from hashicorp/b-vpc-peer-failed
Browse files Browse the repository at this point in the history
providers/aws: vpc peering failed == deleted [GH-2322]
  • Loading branch information
mitchellh committed Jun 29, 2015
2 parents b257efa + e2e8d37 commit 4b5b6b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions builtin/providers/aws/resource_aws_vpc_peering_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4b5b6b6

Please sign in to comment.