AWS SDK for .NET Documentation
PutBucketRequest Class
AmazonAmazon.S3.ModelPutBucketRequest Did this page help you?   Yes   No    Tell us about it...
The parameters to request creation of a new bucket.
Declaration Syntax
C#
public class PutBucketRequest : S3PutWithACLRequest
Members
All MembersConstructorsMethodsProperties



IconMemberDescription
PutBucketRequest()()()()
Initializes a new instance of the PutBucketRequest class

AddHeader(String, String)
Adds the header to the collection of headers for the request.
(Inherited from S3Request.)
AddHeaders(NameValueCollection)
Adds all of the specified key/value pairs into the request headers collection.
(Inherited from S3Request.)
BucketName
The name of the bucket to be created.

BucketRegion
The region locality for the bucket. Default: S3Region.US

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-northeast-1, sa-east-1

CannedACL
Applies a canned access control list (ACL) to the new bucket.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()()
Gets the type of the current instance.
(Inherited from Object.)
Grants
Gets the access control lists (ACLs) for this request. Please refer to S3Grant for information on S3 Grants.
(Inherited from S3PutWithACLRequest.)
InputStream
Input stream for the request; content for the request will be read from the stream.
(Inherited from S3Request.)
ReadWriteTimeout
Overrides the default HttpWebRequest ReadWriteTimeout value.
(Inherited from S3Request.)
RemoveCannedACL()()()()
Resets the S3CannedACL previously set in this object.

Timeout
Overrides the default HttpWebRequest timeout value.
(Inherited from S3Request.)
ToString()()()() (Inherited from S3Request.)
UseClientRegion
If set to true the bucket will be created in the same region as the configuration of the AmazonS3 client. Default: false.

WithBucketName(String) Obsolete.
Sets the name of the bucket to be created.

WithBucketRegion(S3Region) Obsolete.
Sets the BucketRegion property for this request. Default: S3Region.US

WithBucketRegionName(String) Obsolete.
Sets the bucket region locality 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-northeast-1, sa-east-1

WithCannedACL(S3CannedACL) Obsolete.
Applies a canned access control list (ACL) to the new bucket.

WithGrants(array<S3Grant>[]()[][]) Obsolete.
Adds Custom Access Control Lists to the new bucket. Please refer to S3Grant for information on S3 Grants.
Remarks
You can use either a canned ACL or specify access permissions explicitly. You cannot do both.

WithInputStream(Stream) Obsolete.
Sets an input stream for the request; content for the request will be read from the stream.
(Inherited from S3Request.)
WithReadWriteTimeout(Int32) Obsolete.
Overrides the default HttpWebRequest ReadWriteTimeout value.
(Inherited from S3Request.)
WithTimeout(Int32) Obsolete.
Overrides the default HttpWebRequest timeout value.
(Inherited from S3Request.)
WithUseClientRegion(Boolean) Obsolete.
If set to true the bucket will be created in the same region as the configuration of the AmazonS3 client.

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.

CopyPutBucket 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);
Inheritance Hierarchy

Assembly: AWSSDK (Module: AWSSDK) Version: 1.5.60.0 (1.5.60.0)