From RAD Studio API Documentation
Jump to: navigation, search


function CreateBucket(const BucketName: string; BucketACL: TAmazonACLType = amzbaPrivate;  BucketRegion: TAmazonRegion = amzrNotSpecified; ResponseInfo: TCloudResponseInfo = nil): Boolean;


bool __fastcall CreateBucket(const System::UnicodeString BucketName, TAmazonACLType BucketACL = (TAmazonACLType)(0x1), TAmazonRegion BucketRegion = (TAmazonRegion)(0x0), Data::Cloud::Cloudapi::TCloudResponseInfo* ResponseInfo = (Data::Cloud::Cloudapi::TCloudResponseInfo*)(0x0));


Type Visibility Source Unit Parent
function public
Data.Cloud.AmazonAPI TAmazonStorageService


Creates a new bucket with the given name on the S3 service.

Bucket names must be unique to the Amazon S3 service (Amazon Simple Storage Service). That means that, if someone else has already used a given bucket name with their account, you cannot create a bucket with the same name.

Bucket names have some restrictions:

  • They must start with a number or letter.
  • They can contain periods, underscores and dashes, numbers, and lowercase letters.
  • They must be in the range from 3 through 255 characters (although they usually should not be longer than 63 characters).
  • They must not be formatted like an IP address (for example,

Furthermore, if you specify a region when creating the bucket, its name must follow these rules:

  • It cannot contain underscores.
  • It must be in the range from 3 through 63 characters.
  • It cannot end in a dash.
  • It cannot contain two adjacent periods.
  • It cannot contain a dash next to a period (for example, 'my.-bucket').

You can set the access control list of the bucket, the region, or both with this call. Also, you can choose a region to reduce costs or to optimize latency. For example, if you are in Europe, you will probably want to create buckets in the EU region.

The following table shows the significance of the parameters:

Parameter Description


The name of the bucket to create.


The ACL value to use in the bucket creation. Default is amzbaPrivate.


The region to create the bucket in.


The optional class for storing response info into.

The method returns True if the creation was successful, and False otherwise.

See Also