Skip to content

Commit

Permalink
hashicorpGH-5335 - Adding in retry to allow AWS to catch up via API
Browse files Browse the repository at this point in the history
  • Loading branch information
jrnt30 committed May 27, 2016
1 parent 6e586c8 commit 282b2aa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion builtin/providers/aws/resource_aws_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,18 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error creating route: %s", err)
}

route, err := findResourceRoute(conn, d.Get("route_table_id").(string), d.Get("destination_cidr_block").(string))
var route *ec2.Route
err = resource.Retry(2*time.Minute, func() *resource.RetryError {
route, err = findResourceRoute(conn, d.Get("route_table_id").(string), d.Get("destination_cidr_block").(string))

if err != nil {
log.Print("[DEBUG] Attempting to find route in route table %s again", d.Get("route_table_id").(string))
return resource.RetryableError(err)
}

return nil
})

if err != nil {
return err
}
Expand Down

0 comments on commit 282b2aa

Please sign in to comment.