S3 image upload access denied while backups upload working fine

Hi,
I ran into a similar issue with a different cause. Uploads to the backup bucket worked, but the uploads bucket didn’t work.

Turns out it was because the uploads bucket was set to block all public access. (Which I think is the default now.) When I tested uploading locally, it worked fine, but Discourse was uploading with “public-read” access, and S3 rejected that. (I would have guessed that S3 would save the “public-read” status on the file, but then reject public access attempts.) I ended up having to hack in extra logging to find out what options were being used for the upload.

Perhaps Discourse could use the GetPublicAccessBlock API to check if the bucket is configured properly when setting the “s3 upload bucket” setting?