Object key
An object key is the name used to address an object within an object-storage bucket.
In S3, the case-sensitive key is the complete name, including prefixes and delimiters. Its limit is 1,024 bytes in UTF-8, not a fixed character count. [1]
The bucket supplies the key's namespace; a version ID additionally selects a stored version when S3 versioning applies. A key is not a checksum or a version identifier. [2]
In S3 general-purpose buckets, a slash can support folder-like presentation without making the key a filesystem path. S3 separately provides a hierarchical namespace for directory buckets; do not generalize the flat model to every bucket type. [3] [4]
ListObjectsV2 can percent-encode returned names with encoding-type=url. Treat that response representation separately from the key: report%252Ffinal decodes once to report%2Ffinal, not report/final. Check whether a client has already decoded the response before decoding it. [5] [6]
Relations
Advantages
- A bucket and exact key identify the object name independently of its presentation as folders. [2, 3]
Limitations
- Path normalization by a client can change the key sent to S3 when it contains standalone dot or dot-dot segments. [1]
Citations
- Amazon S3: Naming objects, case, UTF-8 length and full keys
- Amazon S3: Keys and version-specific identity
- Amazon S3: Console folders and zero-byte marker objects
- Amazon S3: Directory buckets and hierarchical namespaces
- Amazon S3 API: ListObjectsV2, response encoding and fields
- RFC 3986, section 2.4: When to Encode or Decode