providers/aws: internet gateway delete is more flexible

This commit is contained in:
Mitchell Hashimoto 2014-07-08 16:05:08 -07:00
parent 5bec1ac383
commit 66c716540f
1 changed files with 6 additions and 2 deletions

View File

@ -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" {
if ok {
if ec2err.Code == "InvalidInternetGatewayID.NotFound" {
err = nil
} else if ec2err.Code == "Gateway.NotAttached" {
err = nil
}
}
if err != nil {