Use path-style amazon aws sdk go
Asked Answered
C

1

5

I'm using some aws-sdk-go functionalities in my app, and it creates DNS style hosts to request, like somebucket.mys3.com. But I have some DNS issues and want to receive the requests in path-style, like mys3.com/somebucket. How can I config the SDK to generates it requests in path-style mode?

Chug answered 4/8, 2019 at 13:22 Comment(0)
J
10

In the aws.Config set the S3ForcePathStyle to true, ie

ses, err := session.NewSession(
   &aws.Config{
      S3ForcePathStyle: aws.Bool(true),
      ...
   }
)
Judicature answered 4/8, 2019 at 14:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.