providers/aws: gateway detach is idempotent
This commit is contained in:
parent
c9bb814917
commit
5bec1ac383
|
@ -180,9 +180,16 @@ func resource_aws_internet_gateway_detach(
|
|||
s.ID,
|
||||
s.Attributes["vpc_id"])
|
||||
_, 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 err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
delete(s.Attributes, "vpc_id")
|
||||
|
||||
|
|
Loading…
Reference in New Issue