Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)

When I try the "ListAllBucket" policy it is denied. Why?

The Policy looks like this:

{

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

"Statement": [

    {

        "Effect": "Allow",

        "Action": "s3:ListAllMyBuckets",

        "Resource": "arn:aws:s3:::*"

    },

    {

        "Effect": "Allow",

        "Action": "s3:*",

        "Resource": [

            "arn:aws:s3:::<somebucketname>",

            "arn:aws:s3:::<somebucketname>/*"

        ]

    }

]

}

Any help would be appreciated!!

1 Answer

0 votes
by (12.4k points)

If you expand and see the action listed inside "Action Setting and results", the policy simulator writes about "ListAllBuckets". So Your policy should have "Resource": "*", like:

{

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

    "Statement": [

        {

            "Effect": "Allow",

            "Action": "s3:ListAllMyBuckets",

            "Resource": "*"

        },

        {

            "Effect": "Allow",

            "Action": "s3:*",

            "Resource": [

                "arn:aws:s3:::<somebucketname>",

                "arn:aws:s3:::<somebucketname>/*"

            ]

        }

    ]

}

Do Check out the AWS Certification Course offered by Intellipaat.

Also, you can go through the video tutorial about IAM Policy.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...