Search code examples
amazon-web-servicesamazon-s3bucket

Bucket policy not finding the resource


I have created a first bucket policy to grant full access to a specific IAM user, so far with only one policy, that configuration goes well.

enter image description here

Now I'm trying to add another policy in my code. I use the official policies generator here. However, when I apply the code I get an error saying: "Action does not apply to any resource(s) in statement".

If we dive into the policy code is very clear that for every policy was assigned a resource.

enter image description here

Can please someone in the community help me to understand where is the error in the policy that includes two different rules. thanks so much I appreciate.


Solution

  • s3:ListBucket is a bucket level permission to list all the objects. In a Bucket policy, you can only apply object-level permission, ie., anything inside the bucket . So, If you remove s3:ListBucket it would work.