providers/aws: handle eventual consistency of AWS in aws_vpc
This commit is contained in:
parent
4f10569037
commit
6deea2a93b
|
@ -126,9 +126,13 @@ func VPCStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc {
|
|||
return func() (interface{}, string, error) {
|
||||
resp, err := conn.DescribeVpcs([]string{id}, ec2.NewFilter())
|
||||
if err != nil {
|
||||
if ec2err, ok := err.(*ec2.Error); ok && ec2err.Code == "InvalidVpcID.NotFound" {
|
||||
resp = nil
|
||||
} else {
|
||||
log.Printf("Error on VPCStateRefresh: %s", err)
|
||||
return nil, "", err
|
||||
}
|
||||
}
|
||||
|
||||
if resp == nil {
|
||||
// Sometimes AWS just has consistency issues and doesn't see
|
||||
|
|
Loading…
Reference in New Issue