I’m unable to get S3 presigned post to work with localstack.
I’m using @aws-sdk/client-s3 and @aws-sdk/s3-presigned-post npm packages on a node application to communicate with S3.
My S3 client config:
Looks like the issue is that the url returned by @aws-sdk/s3-presigned-postcreatePresignedPost is http://localhost:4566/ without bucket name appended to it (source).
I’m not sure how this is supposed to work with localstack, but it doesn’t seem to handle presigned post calls to base path and when I manually append the bucket name to the url, it is working as expected.
Is this a bug in the @aws-sdk/s3-presigned-postcreatePresignedPost and it should respect forcePathStyle config or should localstack handle the post calls to base path?
In any case, LocalStack won’t be able to handle a POST call to the base path.
If the sample above does not help you, would you mind sharing a sample to reproduce the issue?
Thanks!
Interesting. I tested it now and it indeed is working as expected.
I was so sure that it was not working before that I decided to do a sanity check.
I do not remember exactly which version I was initially using, but I picked a random one release 2 weeks ago and it seems that AWS has fixed something as it is working as expected with v3.266.0 (current latest), but not with v3.258.0.
I checked again the source and looks like they have fixed it 5 days ago .
It is always a bit hard to debug between all SDK available (as our integration test suite mostly uses boto), and we didn’t hear about this issue yet, but I’m really glad it got fixed now.
And thank you for your feedback, at least we know there’s a potential issue there if this problem comes up again!