brbcoffee
brbcoffee

Reputation: 85

AWS: Cannot delete folders with current IAM policy

I am using the policy pasted below. This policy does almost everything I intend it to do. The user can get to the specified folder (/full/test/next/) within the specified bucket (BUCKETNAME). They can upload files, delete files, create new folders...etc.

However, they cannot delete folders created within this directory (i.e. cannot delete /full/test/next/examplefolder). I've been searching around and doing some modification but I have not found any answers. Any help would be much appreciated.

I apologize for any lack of clarity or incorrect terminology. I am new to AWS.

Two additional notes: 1. I can delete these folders from the main administrative account. 2. As the user, I do NOT have any rights within these folders (even if the user created the folders).

Pasted Code -

{
  "Version": "2012-10-17",
  "Statement": [
   {
     "Sid": "AllowUserToSeeBucketListInTheConsole",
     "Action": ["s3:ListAllMyBuckets", "s3:GetBucketLocation"],
     "Effect": "Allow",
     "Resource": ["arn:aws:s3:::*"]
   },
   {
      "Sid": "AllowRootAndHomeListingOfProperFolder",
      "Action": ["s3:ListBucket"],
      "Effect": "Allow",
      "Resource": ["arn:aws:s3:::BUCKETNAME"],
      "Condition":{"StringEquals":{"s3:prefix":["","full/","full/test/", "full/test/next/", "full/test/next/*"],"s3:delimiter":["/"]}}
   },
   {
     "Sid": "AllowAllS3ActionsInUserFolder",
     "Effect": "Allow",
     "Action": ["s3:*"],
     "Resource": ["arn:aws:s3:::BUCKETNAME/full/test/next/*"]
   }

  ]
}

Upvotes: 3

Views: 535

Answers (1)

slayedbylucifer
slayedbylucifer

Reputation: 23502

Ok, I can confirm this that this is an issue with the Browser. I had the exact same problem and after a lot of head banging, I figured out that it was a trivial issue. I changed my browser and it worked. Also, I was able to delete the folder using AWS CLI as well as AWS Ruby SDK.

So, there is nothing wrong in your policy.

Upvotes: 2

Related Questions