Merge pull request #3616 from Vlatombe/GH-3615

provider/aws: ignore association not exist on route table destroy [GH-3615]
This commit is contained in:
Paul Hinze 2015-10-29 14:56:16 -05:00
commit 73569dc83c

View File

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