PUT Bucket

Description

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.

To create a bucket, you must authenticate with an account that has a valid AWS Access Key ID and is registered with Amazon S3. Anonymous requests are never allowed to create buckets.

[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.

Requests

Syntax

PUT / HTTP/1.1
Host: destinationBucket.s3.amazonaws.com
Content-Length: 0
Date: date
Authorization: signature

Headers

This operation uses standard request headers.

Responses

Success Response

Syntax

HTTP/1.1 200 OK
x-amz-id-2: id
x-amz-request-id: request_id
Date: date
Content-Length: 0
Connection: close
Server: AmazonS3

Elements

This operation uses standard response elements.

Special Errors

There are no special errors for this operation. For information about general Amazon S3 errors, see List of Error Codes.

Examples

Sample Request

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

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

Sample Request

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

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

Related Resources