providers/aws/aws_security_group: we need to check for one other error
This commit is contained in:
parent
99ac8fc68e
commit
916ca711ad
|
@ -205,10 +205,15 @@ func SGStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc {
|
||||||
sgs := []ec2.SecurityGroup{ec2.SecurityGroup{Id: id}}
|
sgs := []ec2.SecurityGroup{ec2.SecurityGroup{Id: id}}
|
||||||
resp, err := conn.SecurityGroups(sgs, nil)
|
resp, err := conn.SecurityGroups(sgs, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if ec2err, ok := err.(*ec2.Error); ok &&
|
if ec2err, ok := err.(*ec2.Error); ok {
|
||||||
ec2err.Code == "InvalidSecurityGroupID.NotFound" {
|
if ec2err.Code == "InvalidSecurityGroupID.NotFound" ||
|
||||||
|
ec2err.Code == "InvalidGroup.NotFound" {
|
||||||
resp = nil
|
resp = nil
|
||||||
} else {
|
err = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
log.Printf("Error on SGStateRefresh: %s", err)
|
log.Printf("Error on SGStateRefresh: %s", err)
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue