tags:

views:

16

answers:

1

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.

+1  A: 

Per the S3 Technical FAQs and 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:

To comply with Amazon S3 requirements, bucket names:

  • Can contain lowercase letters, numbers, periods (.), underscores (_), and dashes (-)

  • Must start with a number or letter

  • Must be between 3 and 255 characters long

  • Must not be formatted as an IP address (e.g., 192.168.5.4)

To conform with DNS requirements, we recommend following these additional guidelines when creating buckets:

  • Bucket names should not contain underscores (_)

  • Bucket names should be between 3 and 63 characters long

  • Bucket names should not end with a dash

  • Bucket names cannot contain two, adjacent periods

  • Bucket names cannot contain dashes next to periods (e.g., "my-.bucket.com" and "my.-bucket" are invalid)

zach at longtail