PutBucketRequest Class

.NET Framework 4.5
 
 
 
Did this page help you?  Yes  No   Tell us about it...
Container for the parameters to the PutBucket operation.

Creates a new bucket.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.S3.Model.PutWithACLRequest
      Amazon.S3.Model.PutBucketRequest

Namespace: Amazon.S3.Model
Assembly: AWSSDK.dll
Version: 2.0.0.3

Syntax

C#
public class PutBucketRequest : PutWithACLRequest
         IRequestEvents

The PutBucketRequest type exposes the following members

Constructors

  Name Description
Public Method PutBucketRequest()

Properties

  Name Description
Public Property BucketName The name of the bucket to be created.
Public Property BucketRegion The region locality for the bucket.
Public Property 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
Public Property CannedACL The canned ACL to apply to the bucket.
Public Property Grants Gets the access control lists (ACLs) for this request. Please refer to for information on S3 Grants.
Public Property UseClientRegion If set to true the bucket will be created in the same region as the configuration of the AmazonS3 client. Default: false.

Examples

This example shows how to create a bucket in a specific region and with a canned ACL configuring the bucket to be public readable.

PutBucket sample


// 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);

                

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8

.NET for Windows Phone:
Supported in: Window Phone 8