Iam new to AWS and now Iam facing the access denied problem when excuted
aws s3api list-objects --bucket BUCKET_NAME
Here are what I configured:
IAM Role policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*",
"s3-object-lambda:*"
],
"Resource": "*"
}
]
}
Bucket Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAllActionsForUsersWhoCanList",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::BUCKET_NAME/*",
"arn:aws:s3:::BUCKET_NAME"
]
}
]
}
After trying numerous solutions, I finally realized that the problem was with my VPC endpoint to S3. There was a policy limiting access to resources. I want to express special thanks to John Rotenstein, who provided me with a lot of advice