AWS S3 upload - unable to sign request without credentials set

I was getting the same error message as the original poster here, with a similar configuration. I verified that I could get and put s3 objects using the AWS CLI from my EC2 instance even though Discourse was unable to do that.

I created a new IAM user with the same permissions policy as my EC2 instance role and used an access key instead of EC2 instance profile and now uploads work fine.

So in my case it wasn’t an issue of changing permissions, which makes me think that there may be a bug in instance profile authentication. Is there any way for me to get more information about why this was failing?