diff --git a/connection/aws.go b/connection/aws.go index d40acd9a..94bab8c3 100644 --- a/connection/aws.go +++ b/connection/aws.go @@ -121,10 +121,13 @@ func (t *AWSConnection) Client(ctx context.Context) (aws.Config, error) { } options := []func(*config.LoadOptions) error{ - config.WithRegion(t.Region), config.WithHTTPClient(&http.Client{Transport: tr}), } + if t.Region != "" { + options = append(options, config.WithRegion(t.Region)) + } + if !t.AccessKey.IsEmpty() { options = append(options, config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(t.AccessKey.ValueStatic, t.SecretKey.ValueStatic, ""))) }