PUT Bucket

The PUT request operation with a bucket URI creates a new bucket. Depending on your latency and legal requirements, you can specify a location constraint that will affect where your data physically resides. You can currently specify a Europe (EU) location constraint.

[Note]Note

Not every string is an acceptable bucket name. For information on bucket naming restrictions, see Working with Amazon S3 Buckets.

If you create a bucket using <CreateBucketConfiguration>, applications that access your bucket must be able to handle 307 redirects.

If you do not specify a location constraint, Amazon S3 automatically selects a location which will be billed at the standard Amazon S3 rates.

To determine whether a bucket name exists, use HEAD, specify the name of the bucket, and set max-keys to 0. A NoSuchBucket response indicates that the bucket is available, an AccessDenied response indicates that someone else owns the bucket, and a Success response indicates that you own the bucket or have permission to access it.

Example

This request creates a bucket named "colorpictures" without a location constraint.

Sample Request

PUT / HTTP/1.1
Host: colorpictures.s3.amazonaws.com
Content-Length: 0
Date: Wed, 01 Mar  2006 12:00:00 GMT
Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=

Sample Response

HTTP/1.1 200 OK
x-amz-id-2: YgIPIfBiKa2bj0KMg95r/0zo3emzU4dzsD4rcKCHQUAdQkf3ShJTOOpXUueF6QKo
x-amz-request-id: 236A8905248E5A01
Date: Wed, 01 Mar  2006 12:00:00 GMT
Location: /colorpictures
Content-Length: 0
Connection: close
Server: AmazonS3

This request creates a bucket named "colourpictures" using the Europe location constraint.

Sample Request

PUT / HTTP/1.1
Host: colourpictures.s3.amazonaws.com
Content-Length: 111
Date: Wed, 01 Mar  2006 12:00:00 GMT
Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=

<CreateBucketConfiguration>
        <LocationConstraint>EU</LocationConstraint>
</CreateBucketConfiguration>

Sample Response

HTTP/1.1 200 OK
x-amz-id-2: YgIPIfBiKa2bj0KMg95r/0zo3emzU4dzsD4rcKCHQUAdQkf3ShJTOOpXUueF6QKo
x-amz-request-id: 236A8905248E5A01
Date: Wed, 01 Mar  2006 12:00:00 GMT
Location: /colourpictures
Content-Length: 0
Connection: close
Server: AmazonS3

You must authenticate with a valid AWS Access Key ID that has been registered as a user of Amazon S3. Anonymous requests are never allowed to create buckets.