AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Creates a new bucket.
Namespace: Amazon.S3.Model
Assembly: AWSSDK.dll
Version: 0.0.3.0
public class PutBucketRequest : PutWithACLRequest IRequestEvents
The PutBucketRequest type exposes the following members
Name | Description | |
---|---|---|
![]() |
PutBucketRequest() |
Name | Description | |
---|---|---|
![]() |
BucketName | The name of the bucket to be created. |
![]() |
BucketRegion | The region locality for the bucket. |
![]() |
BucketRegionName | The bucket region locality expressed using the name of the region. When set, this will determine where your data will reside in S3. Valid values: us-east-1, us-west-1, us-west-2, eu-west-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1 |
![]() |
CannedACL | The canned ACL to apply to the bucket. |
![]() |
Grants | Gets the access control lists (ACLs) for this request. Please refer to S3Grant for information on S3 Grants. |
![]() |
UseClientRegion | If set to true the bucket will be created in the same region as the configuration of the AmazonS3 client. If PutBucketRequest.BucketRegion or PutBucketRequest.BucketRegionName are set they take precedence over this property. Default: true. |
This example shows how to create a bucket in a specific region and with a canned ACL configuring the bucket to be public readable.
// Create a client AmazonS3Client client = new AmazonS3Client(); // Construct request PutBucketRequest request = new PutBucketRequest { BucketName = "SampleBucket", BucketRegion = S3Region.EU, // set region to EU CannedACL = S3CannedACL.PublicRead // make bucket publicly readable }; // Issue call PutBucketResponse response = client.PutBucket(request);
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8
.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8