Skip to content

Commit

Permalink
r/aws_elb: Add configurable Create timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Jun 15, 2023
1 parent 5b5f923 commit 7bb3daf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changelog/31976.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```release-note:bug
resource/aws_elb: Recreate the resource if `subnets` is updated to an empty list
```

```release-note:enhancement
resource/aws_elb: Add configurable Create timeout
```
6 changes: 5 additions & 1 deletion internal/service/elb/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func ResourceLoadBalancer() *schema.Resource {
verify.SetTagsDiff,
),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(5 * time.Minute),
},

Schema: map[string]*schema.Schema{
"access_logs": {
Type: schema.TypeList,
Expand Down Expand Up @@ -303,7 +307,7 @@ func resourceLoadBalancerCreate(ctx context.Context, d *schema.ResourceData, met
input.Subnets = flex.ExpandStringSet(v.(*schema.Set))
}

_, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, 5*time.Minute, func() (interface{}, error) {
_, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func() (interface{}, error) {
return conn.CreateLoadBalancerWithContext(ctx, input)
}, elb.ErrCodeCertificateNotFoundException)

Expand Down

0 comments on commit 7bb3daf

Please sign in to comment.