Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the restrictions on object IDs in Amazon S3?

Tags:

amazon-s3

I recently found out that you can fake directory structure on S3 by putting slashes in your filenames. That got me thinking: are there any restrictions at all on object IDs? I'm sure there must be some. Length? Null characters (\0)? Arcane stuff like invalid UTF-8 characters?

I'm sure there must be some restrictions, but I can't seem to find them anywhere in the documentation.

like image 651
p-static Avatar asked Jun 30 '10 03:06

p-static


1 Answers

Per the technical documentation:

A key is a sequence of Unicode characters whose UTF-8 encoding is at most 1024 bytes long.

Buckets names have additional restrictions:

We recommend that all bucket names comply with DNS naming conventions.

The rules for DNS-compliant bucket names are:

  • Bucket names must be at least 3 and no more than 63 characters long.
  • Bucket names must be a series of one or more labels. Adjacent labels are separated by a single period (.). Bucket names can contain lowercase letters, numbers, and hyphens. Each label must start and end with a lowercase letter or a number.
  • Bucket names must not be formatted as an IP address (e.g., 192.168.5.4).

At this moment DNS compliant names are not enforced in the US Standard region but Amazon is moving towards that.

like image 150
Zachary Ozer Avatar answered Oct 10 '22 21:10

Zachary Ozer