Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ func (o *AWS) getCallingConfig(ctx context.Context, region string) (awsSdk.Confi
o._onceCallingConfig[region].Do(func() {
o._callingConfig[region], o._callingConfigError[region] = func() (awsSdk.Config, error) {
if !o.useAssumeRole {
return o.baseConfig, nil
cfg := o.baseConfig.Copy()
cfg.RetryMaxAttempts = 10
cfg.RetryMode = awsSdk.RetryModeAdaptive
return cfg, nil
}
l := ctxzap.Extract(ctx)

Expand All @@ -131,10 +134,12 @@ func (o *AWS) getCallingConfig(ctx context.Context, region string) (awsSdk.Confi
}

return awsSdk.Config{
HTTPClient: o.baseClient,
Region: region,
DefaultsMode: awsSdk.DefaultsModeInRegion,
Credentials: callingCreds,
HTTPClient: o.baseClient,
Region: region,
DefaultsMode: awsSdk.DefaultsModeInRegion,
Credentials: callingCreds,
RetryMaxAttempts: 10,
RetryMode: awsSdk.RetryModeAdaptive,
}, nil
}

Expand Down Expand Up @@ -171,6 +176,8 @@ func (o *AWS) getCallingConfig(ctx context.Context, region string) (awsSdk.Confi
Credentials: awsSdk.NewCredentialsCache(stscreds.NewAssumeRoleProvider(callingSTSService, o.roleARN, func(aro *stscreds.AssumeRoleOptions) {
aro.ExternalID = awsSdk.String(o.externalID)
})),
RetryMaxAttempts: 10,
RetryMode: awsSdk.RetryModeAdaptive,
}

// this is ok, since the cache will keep them. we want to centralize error handling for this.
Expand Down
Loading