Skip to content

Commit

Permalink
feat: use default region if not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Aug 21, 2024
1 parent 29114d1 commit f80f6e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion connection/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")))
}
Expand Down

0 comments on commit f80f6e9

Please sign in to comment.