-
Using the sdk, if I set the endpoint to
I get the same if I set the endpoint to something made up like Why does it always do the lookup of Sample code (left out error-handling, etc): endpoint := "http://127.0.0.1:66554"
bucket := "mybucket"
cfg, err := config.LoadDefaultConfig(context.TODO(),
config.WithEndpointResolver(
aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
return aws.Endpoint{URL: endpoint}, nil
}),
),
)
client := s3.NewFromConfig(cfg)
uploader := manager.NewUploader(client)
_, err = uploader.Upload(context.TODO(), &s3.PutObjectInput{
Bucket: aws.String(bucket),
Key: aws.String("/path/to/put/object"),
Body: f,
}) The above will try to look up |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @deitch , |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @deitch ,
This is because the new bucket endpoint paradigm is virtual hosted style url.
Its not clear what is the expectation from your question, but I assume you are aiming to format your URL as path style urls?
If so you need to explicitly enable this option because S3 has largely moved away from path style urls.
You can read more about it in my comment here.
Thanks,
Ran~
Answer: