I am now trying to use AWS S3.
I created an IAM user with no "Permissions policies".
And, the bucket policy of S3 is set as follows.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "SpecificIAMPermission",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111111111111:user/iam-user"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::bucketname",
"arn:aws:s3:::bucketname/*"
]
}
]
}
However, this setting gives an access denied error.
Buckets and IAM users are in the same AWS account.
By the way, if I give full access permission of S3 in the policy setting of IAM, it works properly.
Is there a way to access with only S3 bucket policy without giving any "Permission Policy" to IAM users?
If you know anything, I'd be happy to let you know.
Thank you!
Additional description
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "SpecificIAMPermission",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::bucketname",
"arn:aws:s3:::bucketname/*"
]
}
]
}
I can access the image data from the web browser by writing the code as above.
However, access will be denied if I execute PutObject processing in the server-side implementation.
I tried to give PutObjectACL permission to IAM user, but access was denied.