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?
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 .