Overview
A DreamObjects bucket name must be DNS-compliant and unique, because the bucket name is used as part of the hostname in the URL when accessing the bucket's contents. Choose the name carefully when you create a bucket.
Why do bucket names have to be unique?
Objects stored in DreamObjects are identified by a URL that looks like this:
https://$BUCKET_NAME.s3.us-east-005.dream.io/$OBJECT_NAME
Since the bucket name is part of the hostname in the URL, and hostnames must be unique, the bucket name must also be unique. For example, a bucket named "my-bucket" would have the following URL:
https://my-bucket.s3.us-east-005.dream.io
This means there can only be one bucket called "my-bucket" on DreamObjects. Therefore, the easiest way to create a new bucket is to assign a random name and create a domain alias for it using the DreamHost Control Panel.
What are the rules for naming a bucket?
A bucket name:
- Can be 6-63 characters in length
- Can use lowercase letters (a-z) and hyphens (-)
- Cannot use a period (.)
- May not start with (b2-), as this prefix is reserved
- Cannot include any Unicode characters, emoji, or non-printable ASCII
How does DreamHost enforce these rules?
Many S3-compatible clients already enforce these stricter rules when creating new buckets. If you use a client that does not enforce all of these rules, DreamObjects returns an error stating that the bucket name is invalid.
If your client shows you the HTTP error response, you will see a 400 InvalidBucketName response code, including a link to this article.