| Did this page help you? Yes No Tell us about it... |
This implementation of the PUT operation creates a new bucket. To create
a bucket, you must register with Amazon S3 and have a valid AWS Access Key ID to
authenticate requests. Anonymous requests are never allowed to create buckets. By
creating the bucket, you become the bucket owner.
Not every string is an acceptable bucket name. For information on bucket naming restrictions, see Working with Amazon S3 Buckets.
To configure the Region a bucket resides in, you use the LocationConstraint request element. You might choose a Region to
optimize latency, minimize costs, or address regulatory requirements. For example, if
you reside in Europe, you will probably find it advantageous to create buckets in the EU
(Ireland) Region. For more information, see How to Select a Region for Your Buckets.
![]() | Note |
|---|---|
If you create a bucket using |
To configure the access control settings for a bucket, use the x-amz-acl request header.
PUT / HTTP/1.1 Host:BucketName.s3.amazonaws.com Content-Length:lengthDate:dateAuthorization:signatureValue
This implementation of the operation does not use request parameters.
This implementation of the operation can use the following request headers in addition to the request headers common to all operations. For more information, see Common Request Headers.
| Name | Description | Required |
|---|---|---|
x-amz-acl
|
Sets the ACL of the bucket you're creating. Type: String Valid Values: private | public-read | public-read-write | authenticated-read | bucket-owner-read | bucket-owner-full-control Default: private | No |
| Name | Description | Required |
|---|---|---|
CreateBucketConfiguration
|
Container for bucket configuration settings. Type: Container Ancestor: None | No |
LocationConstraint
|
Specifies the Region where the bucket will be created. Type: Enum Valid Values: EU | eu-west-1 | us-west-1 | us-west-2 | ap-southeast-1 | ap-northeast-1 | sa-east-1 | empty string (for the US Classic Region) Default: US Standard Ancestor: CreateBucketConfiguration | No |
This implementation of the operation does not return response elements.
This implementation of the operation does not return special errors. For general information about Amazon S3 errors and a list of error codes, see Error Responses.
This request creates a bucket named "colorpictures".
PUT / HTTP/1.1 Host: colorpictures.s3.amazonaws.com Content-Length: 0 Date: Wed, 01 Mar 2009 12:00:00 GMT Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=
HTTP/1.1 200 OK x-amz-id-2: YgIPIfBiKa2bj0KMg95r/0zo3emzU4dzsD4rcKCHQUAdQkf3ShJTOOpXUueF6QKo x-amz-request-id: 236A8905248E5A01 Date: Wed, 01 Mar 2009 12:00:00 GMT Location: /colorpictures Content-Length: 0 Connection: close Server: AmazonS3
The following request sets the Region the bucket to EU.
PUT / HTTP/1.1 Host: bucketName.s3.amazonaws.com Date: Wed, 12 Oct 2009 17:50:00 GMT Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE= Content-Type: text/plain Content-Length: 124 <CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <LocationConstraint>EU</LocationConstraint> </CreateBucketConfiguration >
HTTP/1.1 200 OK x-amz-id-2: YgIPIfBiKa2bj0KMg95r/0zo3emzU4dzsD4rcKCHQUAdQkf3ShJTOOpXUueF6QKo x-amz-request-id: 236A8905248E5A01 Date: Wed, 01 Mar 2009 12:00:00 GMT Location: /colourpictures Content-Length: 0 Connection: close Server: AmazonS3
This request creates a bucket named "colorpictures" and sets the ACL to
private.
PUT / HTTP/1.1 Host: colorpictures.s3.amazonaws.com Content-Length: 0 x-amz-acl: private Date: Wed, 01 Mar 2009 12:00:00 GMT Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=
HTTP/1.1 200 OK x-amz-id-2: YgIPIfBiKa2bj0KMg95r/0zo3emzU4dzsD4rcKCHQUAdQkf3ShJTOOpXUueF6QKo x-amz-request-id: 236A8905248E5A01 Date: Wed, 01 Mar 2009 12:00:00 GMT Location: /colorpictures Content-Length: 0 Connection: close Server: AmazonS3