Creates an OSS bucket with optional ACL, storage class, and data redundancy settings.
Usage notes
-
The same Alibaba Cloud account can create at most 100 buckets in the same region.
-
Each region has a corresponding endpoint. For more information about the mapping between regions and endpoints, see Endpoints and data centers.
-
Starting October 13, 2025, at 10:00 (UTC+8), OSS begins a phased rollout to enable blocking public access by default for all new buckets. This change applies to buckets created through the API, SDKs, and ossutil. For the specific rollout schedule in each region, see the Notice. When this feature is enabled, you cannot grant public access to the bucket, either through ACLs (such as public-read or public-read-write) or bucket policies. If your use case requires public access, disable this setting after the bucket is created.
Permissions
By default, an Alibaba Cloud account has full permissions. RAM users or RAM roles under an Alibaba Cloud account do not have any permissions by default. The Alibaba Cloud account or account administrator must grant operation permissions through RAM policies or Bucket Policy.
|
API |
Action |
Description |
|
PutBucket |
|
Creates a bucket. |
|
|
After creating a bucket, this permission is required to modify the bucket ACL. |
Command syntax
ossutil api put-bucket --bucket value [flags]
|
Parameter |
Type |
Description |
|
--acl |
string |
The bucket ACL. |
|
--bucket |
string |
The name of the bucket. |
|
--create-bucket-configuration |
string |
The bucket configuration in XML or JSON format. |
|
--resource-group-id |
string |
The ID of the resource group. |
The put-bucket command provides access to the PutBucket operation. For more information about the API operation, see PutBucket.
--create-bucket-configuration
This parameter accepts XML or JSON:
-
XML format:
<?xml version="1.0" encoding="UTF-8"?> <CreateBucketConfiguration> <StorageClass>Standard</StorageClass> <DataRedundancyType>LRS</DataRedundancyType> </CreateBucketConfiguration> -
JSON format:
{ "StorageClass": "Standard", "DataRedundancyType": "LRS" }
For more information, see Command-line options.
Examples
-
Create a bucket named examplebucket.
ossutil api put-bucket --bucket examplebucket -
Create examplebucket with private ACL, resource group rg-123, Standard storage class, and LRS redundancy.
-
XML configuration file (create-bucket-configuration.xml)
<?xml version="1.0" encoding="UTF-8"?> <CreateBucketConfiguration> <StorageClass>Standard</StorageClass> <DataRedundancyType>LRS</DataRedundancyType> </CreateBucketConfiguration>Command:
ossutil api put-bucket --bucket examplebucket --acl private --resource-group-id rg-123 --create-bucket-configuration file://create-bucket-configuration.xml -
JSON configuration file (create-bucket-configuration.json)
{ "StorageClass": "Standard", "DataRedundancyType": "LRS" }Command:
ossutil api put-bucket --bucket examplebucket --acl private --resource-group-id rg-123 --create-bucket-configuration file://create-bucket-configuration.json -
Inline JSON parameters
ossutil api put-bucket --bucket examplebucket --acl private --resource-group-id rg-123 --create-bucket-configuration "{\"StorageClass\":\"Standard\",\"DataRedundancyType\":\"LRS\"}"
-