* Issue #2174 Check that InternetGateway exists before returning from creation Fix some random InvalidInternetGatewayID.NotFound errors * Issue #2174 Reuse IGStateRefreshFunc * Issue #2174 Need to wait for creation before setting tags
This commit is contained in:
parent
65bef82a32
commit
32bd25d743
|
@ -45,6 +45,18 @@ func resourceAwsInternetGatewayCreate(d *schema.ResourceData, meta interface{})
|
|||
d.SetId(*ig.InternetGatewayId)
|
||||
log.Printf("[INFO] InternetGateway ID: %s", d.Id())
|
||||
|
||||
resource.Retry(5*time.Minute, func() *resource.RetryError {
|
||||
igRaw, _, err := IGStateRefreshFunc(conn, d.Id())()
|
||||
if igRaw != nil {
|
||||
return nil
|
||||
}
|
||||
if err == nil {
|
||||
return resource.RetryableError(err)
|
||||
} else {
|
||||
return resource.NonRetryableError(err)
|
||||
}
|
||||
})
|
||||
|
||||
err = setTags(conn, d)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue