chore: #64 add system hardening with retry logic for client #68
1 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
|
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
|
||||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||||
|
|
@ -477,7 +478,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
||||||
providerData.Experiments = experimentValues
|
providerData.Experiments = experimentValues
|
||||||
}
|
}
|
||||||
|
|
||||||
roundTripper, err := sdkauth.SetupAuth(sdkConfig)
|
baseRoundTripper, err := sdkauth.SetupAuth(sdkConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
core.LogAndAddError(
|
core.LogAndAddError(
|
||||||
ctx,
|
ctx,
|
||||||
|
|
@ -488,6 +489,14 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roundTripper := core.NewRetryRoundTripper(
|
||||||
|
baseRoundTripper,
|
||||||
|
maxRetries,
|
||||||
|
initialDelay,
|
||||||
|
maxDelay,
|
||||||
|
perTryTimeout,
|
||||||
|
)
|
||||||
|
|
||||||
// Make round tripper and custom endpoints available during DataSource and Resource
|
// Make round tripper and custom endpoints available during DataSource and Resource
|
||||||
// type Configure methods.
|
// type Configure methods.
|
||||||
providerData.RoundTripper = roundTripper
|
providerData.RoundTripper = roundTripper
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue