0

What permission do I need to change to allow listing all s3 buckets?

I can run: aws s3 ls s3://bucketname; but I cannot run: aws s3 ls;

The bucket policy is this:

    "Version": "2012-10-17",
    "Statement": [

        {
            "Sid": "Sid",
            "Effect": "Allow",
            "Principal": {
                "AWS": [
                    "arn:aws:iam::6666666:user/myuser"
                ]
            },
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::bucketname"
        }
    ]
}
rupert160
  • 1,441
  • 1
  • 17
  • 19
  • Possible duplicate of [Why is my terminal returning this s3 error?](https://stackoverflow.com/questions/33319678/why-is-my-terminal-returning-this-s3-error) – Louis Sep 26 '19 at 15:30

1 Answers1

0

Credit due from this post: https://stackoverflow.com/a/35746318/1242581

I needed the ListAllMyBuckets action on my user or user's group:

{
    "Sid": "AllowListingOfAllBuckets",
    "Effect": "Allow",
    "Action": [
        "s3:ListAllMyBuckets"
    ],
    "Resource": [
        "arn:aws:s3:::*"
    ]
}
rupert160
  • 1,441
  • 1
  • 17
  • 19