mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: ignore association not exist on route table destroy
[GH-3615]
This commit is contained in:
parent
c817e7c765
commit
44e93526a1
@ -325,6 +325,14 @@ func resourceAwsRouteTableDelete(d *schema.ResourceData, meta interface{}) error
|
|||||||
_, err := conn.DisassociateRouteTable(&ec2.DisassociateRouteTableInput{
|
_, err := conn.DisassociateRouteTable(&ec2.DisassociateRouteTableInput{
|
||||||
AssociationId: a.RouteTableAssociationId,
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user