All Products
Document Center


Last Updated: Jun 24, 2021

Before you upload data such as documents, images, and audio or video files to Object Storage Service (OSS), you must create a bucket in an OSS region. OSS does not impose limits on the number of objects that you can upload to a bucket.

Background information

Buckets and objects are OSS resources. OSS provides API operations to manage these resources. For example, you can call API operations to create a bucket and upload objects to the bucket. You can also perform these operations in the OSS console. When you perform operations in the OSS console, OSS API operations are called to sent requests to OSS.

OSS does not use a hierarchical structure for objects, but instead uses a flat structure. All elements are stored as objects in buckets. However, OSS supports folders as a concept to group objects and simplify management. The name of a bucket is unique within OSS and cannot be modified after the bucket is created. For more information, see bucket naming conventions in Terms.

Related operations

The following table lists supported operations related to buckets. For more information about operations related to objects, see Overview.



Create buckets

Before you can upload objects to OSS, you must create a bucket. The attributes of a bucket include the region, access control list (ACL), and other metadata.

When you create a bucket, you must select a region for the bucket based on your requirements on latency, costs, and compliance. , see For more information about the regions supported by OSS, see Regions and endpoints.

Configure bucket ACLs

You can configure the ACL of a bucket when you create the bucket or modify the ACL of a created bucket. Only the owner of a bucket can configure or modify the ACL of the bucket.

Query the region of a bucket

You can call the GetBucketLocation operation to obtain the region of a bucket, which indicates the data center in which the bucket is located.

List buckets

You can specify different filters to list all buckets or buckets whose names contain a specified prefix in a region.

Configure bucket inventory

You can use the bucket inventory feature to export the information about specific objects in a bucket, such as the number, sizes, storage classes, and encryption status of the objects. Compared with the GetBucket (ListObjects) operation, we recommend that you use the bucket inventory feature to list a large number of objects.

Configure pay-by-requester

When pay-by-requester is enabled for a bucket, requesters pay the request and traffic fees that are incurred when the requesters access objects in the bucket. The bucket owner is still charged for the storage fees of the objects. You can enable pay-by-requester to share your data in OSS without having to pay for additional fees on your own.

Map custom domain names

After you upload objects to a bucket, OSS automatically generates URLs that include the public endpoint of the bucket for the uploaded objects. You can use these URLs to access the objects. If you want to access the objects by using custom domain names, you must map the custom domain names to the bucket in which the objects are stored and add CNAME records for the custom domain names.

Configure transfer acceleration

OSS uses data centers distributed around the globe to implement transfer acceleration. When a request is sent to your bucket, it is resolved and routed to the data center where the bucket resides over the most optimal network path and protocol. The transfer acceleration feature provides an optimized end-to-end acceleration solution to access OSS over the Internet.

Configure CORS

Cross-origin resource sharing (CORS) is a standard cross-origin solution provided by HTML5 to allow web application servers to control cross-origin access, which ensures the security of data transmission across origins.

Configure bucket tagging

OSS allows you to configure bucket tags to classify and manage buckets. For example, you can list buckets that have specific tags and configure ACL for buckets that have specific tags.

Configure event notification

You can configure event notifications for specific objects in a bucket. When the specified events occur on the objects, you are notified as soon as possible.

Configure lifecycle rules

After you configure lifecycle rules for a bucket, OSS converts the storage class of objects in the bucket to Infrequent Access (IA), Archive, Cold Archive, or deletes expired objects and parts on a regular basis to save storage costs.

Configure real-time log query

After you configure real-time log query for a bucket, you can track requests that are sent to access the bucket. This feature allows you to collect access statistics, audit access to OSS, track exceptions, and troubleshoot problems. Real-time log query can improve your efficiency and help you make better decisions based on real-time data.

Configure retention policies

You can configure a time-based retention policy for a bucket. After the retention policy is locked, you can upload objects to the objects or read objects in the bucket. However, objects in the bucket and the retention policy cannot be deleted within the retention period. You can delete objects in the bucket only after the retention period expires.

Bucket Policy

You can configure bucket policies to authorize other users to access the specified OSS resources.

Cross-region replication (CRR)

CRR allows you to replicate objects across buckets in different regions in an automatic and asynchronous (near real-time) manner. Operations such as the creation, overwriting, and deletion of objects are synchronized from the source bucket to the destination bucket.

Configure versioning

OSS allows you to configure versioning for a bucket to protect objects stored in the bucket. After you enable versioning for a bucket, objects that are overwritten or deleted in the bucket are saved as previous versions. You can use versioning to recover a previous version of an object that is accidentally overwritten or deleted.

Configure static website hosting

Static websites are websites in which all web pages consist only of static content, including scripts such as JavaScript code running on the client. You can use the static website hosting feature to host your static website in an OSS bucket and use the endpoint of the bucket to access the website.

Delete buckets

You can delete a bucket that you no longer need.