I get this error in terminal when I try to list all the buckets using boto3: An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied
.
Here's the code:
for bucket in s3.buckets.all():
print(bucket.name)
I found a stack overflow question (Why is my terminal returning this s3 error?) and below is the proposed solution. I'm very unfamiliar with AWS so I need a bit of guidance.
Where can I find the dictionary inside like the one below inside the AWS console?
{
"Sid": "AllowListingOfAllBuckets",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": [
"arn:aws:s3:::*"
]
}