Updated on 2025-08-26 GMT+08:00

Creating a Bucket

You can use OBS Console, SDKs, OBS Browser+, obsutil, or APIs to create a bucket. A bucket is a container that stores objects in OBS. Before you can store data in OBS, you must create a bucket.

Prerequisites

You have created an account, have sufficient account balance, and have obtained access keys (AK and SK) and endpoints. For details, see Getting Started.

Constraints

  • Once a bucket is created, its name and region cannot be changed. Make sure that the bucket name and region you set are appropriate.
  • An account (including all of the IAM users under the account) can create a maximum of 100 buckets. You are advised to use the fine-grained access control of OBS to properly plan and use buckets. For example, you can create folders in a bucket based on object prefixes and use fine-grained access control to isolate data between departments. There is effectively no limit to the total number or size of objects in a bucket, so data scalability is not a concern.

Bucket Naming Rules

A bucket name is part of the access domain name and needs to be resolved. Therefore, a bucket name must conform to the DNS domain naming rules. When receiving a bucket creation request, OBS strictly checks the bucket name. A bucket name:
  • Must be unique across all accounts and regions. You must wait at least 30 minutes before you can reuse the name of a deleted bucket or parallel file system.
  • Must be 3 to 63 characters long. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.
  • Cannot start or end with a period (.) or hyphen (-), and it cannot contain two consecutive periods (..) or contain a period (.) and a hyphen (-) adjacent to each other.
  • Cannot be formatted as an IP address.

Bucket Naming Best Practices

  • Avoid using periods (.) in bucket names. If a bucket has periods (.) in its name, accessing the bucket domain name (bucketname.obs.regionID.myhuaweicloud.com) over HTTPS will fail or trigger a certificate verification warning, for example, a red security alert is displayed in the browser. This is because a wildcard SSL certificate only works for buckets without periods (.) in their names.
  • Avoid using sensitive information in bucket names. A bucket name will be part of the URL of an object in the bucket.
  • Choose a naming rule that can avoid conflicts. Ensure that your program will select another bucket name when the bucket name has been used.

Ways to Create a Bucket

You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to create a bucket.

References