Skip to content

Commit

Permalink
Issue hashicorp#2174 Check that InternetGateway exists before returni…
Browse files Browse the repository at this point in the history
…ng from creation (hashicorp#6105)

* Issue hashicorp#2174 Check that InternetGateway exists before returning from creation

Fix some random InvalidInternetGatewayID.NotFound errors

* Issue hashicorp#2174 Reuse IGStateRefreshFunc

* Issue hashicorp#2174 Need to wait for creation before setting tags
  • Loading branch information
carlossg authored and chrislovecnm committed Apr 16, 2016
1 parent 971b25f commit bc2ff35
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions builtin/providers/aws/resource_aws_internet_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc2ff35

Please sign in to comment.