AWS Android SDK app for S3 Transfer Utility raises read exception

I created an AWS S3 bucket. and I can access the bucket using https://github.com/awslabs/aws-sdk-android-samples/blob/master/S3TransferUtilitySample/S3TransferUtilityTutorial.md , TransferUtility SDK application is provided by Amazon.

I made some changes regarding the configuration of the corresponding region name and bucket, and then I was able to connect to S3.

I have the proper permission to read / write the S3 bucket, as granted to me by the server administrator. I successfully upload two images to an S3 bucket using code. Now I see two image files present in S3.

Now when I try to load this file, I get an exeception as

com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 04800521FBB752B0)

I have read and write permissions, but I get this exception. This is only due to permission, or am I missing something.

Thanks in advance.

+4
source share
3 answers

There was a problem with the previous conginto pool id, I think it had some permissions problems.

We changed the identifier of the cognito pool, and then it worked correctly.

0
source

I think there are other permissions to download. You need to establish who can download this file - reading is not enough. Right-click the file in your S3 bucket and check the permissions section - you will see it there.

+3
source

Amazon S3 AccessDenied, , .

AWS SDK

AWS SDK. , , / .

1) AM, , IAM , [ ], API, API S3.

2 , S3 .

3) , , AWS CL.

4) AWS iam get-user, , .

{ "User": { "UserName": "MY_DEFAULT_USER_NAME", "PasswordLastUsed": "2017-03-15T01:59:05Z", "CreateDate": "2016-04-30T02:46:19Z", "UserId": "ABCDEFGHIJKLMNOPQ", "Path": "/", "Arn": "arn:aws:iam::123456789:user/MY_DEFAULT_USER_NAME" } } 

5) Verify that the environment variable can be AWS keys in my environment variables.

6) For SDS SDK troubleshooting requests, a pair of request identifiers will look like this.

status Code: 403, AWS Service: Amazon S3, AWS Request ID: 79104EXAMPLEB723  
AWS Error Code: AccessDenied  AWS Error Message: Access Denied  
S3 Extended Request ID: IOWQ4fDEXAMPLEQM+ey7N9WgVhSnQ6JEXAMPLEZb7hSQDASK+Jd1vEXAMPLEa3Km

7) Verification The endpoint is correct in the code, there must be a valid endpoint.

0
source

Source: https://habr.com/ru/post/1681732/


All Articles