use shared config state

This commit is contained in:
Tobiasz Heller 2024-01-25 17:55:08 +01:00
parent ce476fe477
commit a0ebcb236a

View File

@ -29,11 +29,15 @@ func NewServer(cfg config.PassConfig) *Server {
if region == "" {
region = "us-east-1"
}
sess, err := session.NewSession(&aws.Config{
Region: aws.String(region),
S3ForcePathStyle: aws.Bool(true),
Endpoint: awsEndpoint,
})
sess, err := session.NewSessionWithOptions(
session.Options{
Config: aws.Config{
Region: aws.String(region),
S3ForcePathStyle: aws.Bool(true),
Endpoint: awsEndpoint,
},
SharedConfigState: session.SharedConfigEnable,
})
if err != nil {
log.Fatal(err)
}