Creating a Bucket
Application Scenario
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. However, there is no restriction 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.
- Must be 3 to 63 characters long. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. If a bucket name contains a period (.), security certificate verification may be triggered when you access the bucket or its objects.
- 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 This Function
You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to create a bucket.
| Tool | Reference |
|---|---|
| OBS Console | |
| SDKs | OBS supports software development kits (SDKs) in mainstream programming languages. For details, see the developer guide on the SDK Overview page. |
| APIs | |
| OBS Browser+ | - |
| obsutil |
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.cn-north-4.myhuaweicloud.com
Causes of Bucket Creation Failures and Solutions
For details, see Failed to Create a Bucket
Last Article: Overview
Next Article: Listing Buckets
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.