meshkati
meshkati

Reputation: 2393

Use path-style amazon aws sdk go

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?

Upvotes: 5

Views: 2610

Answers (1)

ain
ain

Reputation: 22759

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

ses, err := session.NewSession(
   &aws.Config{
      S3ForcePathStyle: aws.Bool(true),
      ...
   }
)

Upvotes: 10

Related Questions