mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
providers/aws: internet gateway delete is more flexible
This commit is contained in:
parent
5bec1ac383
commit
66c716540f
@ -182,8 +182,12 @@ func resource_aws_internet_gateway_detach(
|
||||
_, err := ec2conn.DetachInternetGateway(s.ID, s.Attributes["vpc_id"])
|
||||
if err != nil {
|
||||
ec2err, ok := err.(*ec2.Error)
|
||||
if ok && ec2err.Code == "Gateway.NotAttached" {
|
||||
err = nil
|
||||
if ok {
|
||||
if ec2err.Code == "InvalidInternetGatewayID.NotFound" {
|
||||
err = nil
|
||||
} else if ec2err.Code == "Gateway.NotAttached" {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user