Updated: 22 October 2026 · Applies to: AWS IAM, S3 bucket policies

To let an IAM user see and use only one folder inside an S3 bucket, attach a policy with four blocks: console access, listing the bucket's root and the path down to the target folder, listing inside that folder, and acting on objects inside that folder.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowUserToSeeBucketListInTheConsole",
      "Action": [
        "s3:ListAllMyBuckets",
        "s3:GetBucketLocation"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::*"
      ]
    },
    {
      "Sid": "AllowRootAndHomeListingOfCompanyBucket",
      "Action": [
        "s3:ListBucket"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::mybucket.example.com"
      ],
      "Condition": {
        "StringEquals": {
          "s3:prefix": [
            "",
            "uploads/",
            "uploads/test/",
            "uploads/test/folder/"
          ],
          "s3:delimiter": [
            "/"
          ]
        }
      }
    },
    {
      "Sid": "AllowListingOfUserFolder",
      "Action": [
        "s3:ListBucket"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::mybucket.example.com"
      ],
      "Condition": {
        "StringLike": {
          "s3:prefix": [
            "uploads/test/folder/*"
          ]
        }
      }
    },
    {
      "Sid": "AllowAllS3ActionsInUserFolder",
      "Effect": "Allow",
      "Action": [
        "s3:*"
      ],
      "Resource": [
        "arn:aws:s3:::mybucket.example.com/uploads/test/folder/*"
      ]
    }
  ]
}

Replace mybucket.example.com with your own bucket name, and uploads/test/folder/ with the path to the folder you want this user restricted to.

What each block does

  • Block 1: without ListAllMyBuckets and GetBucketLocation, the IAM user gets a "denied" error just opening the S3 console. These two actions let the user see that buckets exist, but not look inside any of them; what they can actually open depends entirely on the blocks below.
  • Block 2: allows listing the bucket's root and the path down to the target folder, using s3:prefix and s3:delimiter together so the console can walk down through subfolders without exposing their contents.
  • Block 3: allows listing the contents of the target folder itself.
  • Block 4: allows all S3 actions (read, write, delete) on objects inside the target folder.

Related services

AWS managed services

monitoring, cost optimisation, security and 24/7 support.

Hire an expert

engineers per 15 minutes, per hour or per month, with no contract.

Was this answer helpful?

Still stuck? Open a ticket