AWS in 1 Min · Episode 90

S3 buckets, objects and keys explained (and why S3 has no folders)

No folders, just names. Watch the one-minute video, then read the details.

David Gomez1:12 video · 3 min read

"S3 stores your files in folders." Not really. A general purpose S3 bucket is flat. The folders you see in the console are drawn from the names of your objects. Once you understand buckets, objects and keys, S3 permissions, listings and AI pipelines all make more sense.

Buckets: the container

A bucket holds objects. You create it in one Region, and objects stay in that Region unless you copy them elsewhere.

  • By default, bucket names live in a global namespace: a name must be unique across every AWS account in the partition. When someone deletes a bucket, anyone can claim the name again.
  • Since March 2026 you can instead create a general purpose bucket in your account regional namespace. The name ends in a suffix with your account ID and Region (for example docs-111122223333-us-east-1-an), and only your account can create names with that suffix. Existing buckets can't be renamed into it.
  • An account can create 10,000 general purpose buckets by default (you can request more), and there is no limit on how many objects a bucket holds.

You can't change a bucket's name or Region after creating it, so choose both carefully.

Objects: data, metadata and a key

An object is three things together:

  1. The data itself: a PDF, an image, a Parquet file.
  2. Metadata: system metadata such as the content type and size, plus your own user-defined metadata.
  3. A key, the object's unique name in the bucket.

Keys and prefixes: why "folders" are an illusion

The key is the object's full name, up to 1,024 bytes of UTF-8, and it is case sensitive. docs/2026/report.pdf is a single key. The slashes are just characters.

The shared beginning of many keys, like docs/2026/, is a prefix. When you list objects with a prefix and a / delimiter, S3 groups the results, and the console shows them as folders. Creating a "folder" in the console actually writes an empty object whose key ends in /.

This matters in practice:

  • Permissions in bucket and IAM policies target key patterns such as arn:aws:s3:::my-bucket/docs/2026/*.
  • Renaming a folder means copying and deleting every object under that prefix. There is no single rename call.
  • Avoid ./ and ../ segments in keys. Many tools treat them as relative paths and behave unexpectedly.

Where AI fits

S3 is the document store behind many RAG (retrieval-augmented generation) apps: chatbots that answer from your own documents. Amazon Bedrock Knowledge Bases connects to a general purpose bucket in the same Region, optionally limited to an inclusion prefix like docs/2026/. Each sync crawls only new, changed and deleted files.

Next to each document you can place a metadata file named after it, such as report.pdf.metadata.json, with attributes like department or year. The knowledge base stores those attributes, so queries can filter results, for example only this year's HR documents. Good key design pays off here: clean prefixes make it easy to point a knowledge base at exactly the right documents, and to control who can change them. Remember that anyone allowed to query the knowledge base can retrieve what was synced into it.

Quick recap

  • Buckets hold objects, live in one Region, and use the global namespace unless you choose your account regional namespace.
  • An object is data plus metadata plus a key.
  • The key is the full name; folders are just prefixes.
  • For RAG, point Bedrock Knowledge Bases at a bucket or prefix and add .metadata.json files to filter answers.
AWS in 1 Min #90 · 1:12

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS