diff --git a/common/aws/auth/auth_static.go b/common/aws/auth/auth_static.go index 13f24a543..0bfc0f49f 100644 --- a/common/aws/auth/auth_static.go +++ b/common/aws/auth/auth_static.go @@ -49,7 +49,7 @@ func newAuthStatic(ctx context.Context, opts Options, configOpts []func(*config. } switch { - case static.AccessKey != "" && static.SecretKey != "" && static.SessionToken != "": + case static.AccessKey != "" && static.SecretKey != "": static.ProviderType = StaticProviderTypeStatic static.CredentialProvider = credentials.NewStaticCredentialsProvider(opts.AccessKey, opts.SecretKey, opts.SessionToken) diff --git a/common/aws/config.go b/common/aws/config.go index df61f7443..7e4acdfed 100644 --- a/common/aws/config.go +++ b/common/aws/config.go @@ -54,6 +54,13 @@ func NewConfig(ctx context.Context, authOptions auth.Options, opts ...ConfigOpti ) } + if authOptions.Region != "" { + configLoadOptions = append( + configLoadOptions, + config.WithRegion(authOptions.Region), + ) + } + if options.HTTPClient != nil { configLoadOptions = append( configLoadOptions,