Updated on 2023-07-18 GMT+08:00

Creating a Bucket

Scenarios

Buckets are containers that store objects in OBS. You need to create a bucket before you can start storing data in OBS.

Prerequisites

To create a bucket, make sure you have a registered account, sufficient account balance, access keys (AK and SK), and the endpoint information. For details, see Getting Started.

Constraints

  • After a bucket is created, its name and region cannot be changed. Specify a proper region and bucket name when creating the bucket.
  • An account (including all IAM users under the account) can create a maximum of 100 buckets. You can leverage the fine-grained permission control capability 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 permission control to implement permission isolation between departments. There is no limit on the number and total size of objects in a bucket.
  • A bucket name is part of the access domain name and needs to be resolved. Therefore, the bucket name must conform to the DNS domain naming rules. When receiving a bucket creation request, the OBS strictly checks the bucket name. A bucket name:
    • Must be unique across all accounts and regions. The name of a deleted bucket can be reused for another bucket or a parallel file system at least 30 minutes later after the deletion.
    • 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 cannot contain two consecutive periods (..) or contain a period (.) and a hyphen (-) adjacent to each other.
    • Cannot be formatted as an IP address.

    If you use a bucket with periods (.) in its name to access OBS, the client will display a message indicating that the bucket is risky, for example, a red alarm may be displayed in the browser security prompt. This is because the SSL wildcard certificate matches only buckets without periods (.) in their names when HTTPS is used for OBS access. We recommend that you avoid using periods (.) in bucket names.

How to Use

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

Tool

Reference

OBS Console

Creating a Bucket

SDKs

OBS supports software development kits (SDKs) in multiple languages. For details, see the corresponding developer guide on the SDK Overview page.

API

Creating a Bucket

OBS Browser+

Creating a Bucket

obsutil

Creating a Bucket

How to Access a Bucket

After a bucket is created, you can use the domain name to access the bucket. You can assemble the domain name by putting the bucket name and endpoint together, or you can obtain it by viewing the basic bucket information on OBS Console or OBS Browser+.

An access domain name is structured as follows:

[Structure] BucketName.Endpoint

[Example] bucketname.obs.ap-southeast-1.myhuaweicloud.com

Causes of Bucket Creation Failures and Solutions

For details, see Why Am I Unable to Create a Bucket?