GetObjectRequest - Access Denied for Virtual Hosted-Style Request

0

Hello,

I am working in unity and using the latest unity sdk. A couple of days ago i created s3 buckets in EU region while having a few buckets with AP region.
The app worked fine with the AP region bucket and always receives "access denied" error when access objects from EU bucket. Do note that this is not a permissions issue for the buckets.
When looking at the GET request I noticed that the SDK internally generates a path-style request for AP region bucket and hosted-style request. That is the only difference and it is something done by the SDK. I did read that path-style requests will be deprecated by Sept 30 2020. Is this what is affecting my application?
Here are the Get requests
"properties":{"AsyncCall":"True","CanonicalRequest":"GET\n/bucketname/user/profile/userProfile.xml\n\nhost:s3.ap-southeast-2.amazonaws.com
{"AsyncCall":"True","CanonicalRequest":"GET\n/user/profile/userProfile.xml\n\nhost:bucketname.s3.eu-west-2.amazonaws.com

Please advise how to get the GET/PUT requests to work for EU buckets.

Regards

asked 4 years ago285 views
1 Answer
0

I mananged to fix the issue by assigning permissions to the cognito identity pool that was accessing the EU S3 bucket.

To do this
Login to your AWS console
Go To IAM
On left tab, click 'Roles'
Now click on the Role that is related to the cognito identity pool
Edit the Json policy.
Basically your identity pool which is assigned to your cognito user pool should have access to S3.

Following assigns access to all but you may want to restrict the access and the
eg. policy json:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:",
"other stuff:
"
],
"Resource": [
"*"
]
}
]
}

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions