I have S3 bucket called "atest-bucket". Inside of this bucket I have directory named "data". I need to provide access to user from external account to this directory (this user will access my data in order to run AWS ElasticMapReduce job).
With the policy I created, user still getting 403, when trying access it:
Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied;
Here is my policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AccessToDataFiles",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::11111111111:user/emr",
"arn:aws:iam::11111111111:role/EMR_EC2_DefaultRole"
]
},
"Action": "s3:List*",
"Resource": "arn:aws:s3:::atest-bucket/data"
},
{
"Sid": "Stmt1234456",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::11111111111:user/emr",
"arn:aws:iam::11111111111:role/EMR_EC2_DefaultRole"
]
},
"Action": [
"s3:Get*",
"s3:List*",
"s3:Put*"
],
"Resource": "arn:aws:s3:::atest-bucket/data/*"
}
]
}
Please help me investigate this issue.