Skip to content

Commit

Permalink
Merge pull request #3616 from Vlatombe/GH-3615
Browse files Browse the repository at this point in the history
provider/aws: ignore association not exist on route table destroy [GH-3615]
  • Loading branch information
phinze committed Oct 29, 2015
2 parents 79e6f2f + 44e9352 commit 73569dc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions builtin/providers/aws/resource_aws_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ func resourceAwsRouteTableDelete(d *schema.ResourceData, meta interface{}) error
_, err := conn.DisassociateRouteTable(&ec2.DisassociateRouteTableInput{
AssociationId: a.RouteTableAssociationId,
})
if err != nil {
// First check if the association ID is not found. If this
// is the case, then it was already disassociated somehow,
// and that is okay.
if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidAssociationID.NotFound" {
err = nil
}
}
if err != nil {
return err
}
Expand Down

0 comments on commit 73569dc

Please sign in to comment.