Configure a bucket
Bucket settings let you keep previous versions of objects, host a website, delete old data automatically, and allow web pages to load your files. All settings are under Config in the Action column of the bucket.
Versioning
Versioning keeps every version of an object. Each update or deletion creates a new version, so you can restore an earlier one.
- In the Action column of the bucket, click Config.
- Open the Versioning tab.
- Select Enable or Disable, then click Save.
The Portal cannot manage non-current versions. To list, download, or restore them, use an S3 client, S3 Browser, or the SDK.
Static website hosting
Static website hosting serves the HTML, CSS, JavaScript, and other files in a bucket as a website, with a public URL from FPT Object Storage.
- Upload all website files to the bucket.
- In the Action column of the bucket, click Config.
- Open the Static Website Hosting tab and select ENABLE WEBSITE HOSTING.
- Enter the following information, then save:
- Index Document: the home page of the website, usually
index.html. - Error Document: the page shown when a URL does not exist.
- Index Document: the home page of the website, usually
Visitors open the website through the endpoint shown in the tab. Files must be public to load. See Manage permissions.
Lifecycle rules
Lifecycle rules delete objects automatically after a period of time, which saves storage costs. A bucket can have several rules, each for the whole bucket or for objects with a given prefix.
| Action | What it deletes |
|---|---|
| Delete current versions of objects | Current versions after the number of days you set. Without versioning, the object is deleted permanently. |
| Permanently delete non-current versions of objects | Non-current versions after the number of days you set. These exist only when versioning is enabled. |
| Delete incomplete multipart uploads | Uploads that did not complete, after the number of days you set. |
| Delete expired object delete markers | Delete markers that have no older versions left. |
With versioning enabled, deleting an object creates a delete marker instead of removing the data, so you can recover it later. A delete marker expires when all older versions of the object are deleted.
Some high-risk actions, such as deleting files on a fixed date or transitioning storage class, are not available on the Portal. Configure them with an S3 client.
Create a lifecycle rule
- In the Action column of the bucket, click Config.
- Open the Lifecycle Configurations tab and click Create Rule.
- Enter a Rule Name.
- In Rule Scope, select Full for the whole bucket, or enter a prefix.
- Select the actions and the number of days for each, then save. The rule appears in the Lifecycle Configurations tab.
Edit a lifecycle rule
- Click Edit for the rule.
- Change the settings and save.
Delete a lifecycle rule
- Click Delete for the rule.
- In the confirmation dialog, check the rule name and click Delete.
Bucket CORS configuration
By default, browsers block web pages from other origins from reading data in your bucket. A CORS rule tells the browser which origins (websites or servers) may send requests to the bucket and which HTTP methods they may use.
Create a CORS rule
-
In the Action column of the bucket, click Config.
-
Open the Bucket CORS tab and click Create Rule.
-
Enter the rule details:
Field Description Rule Name Name of the rule. Allowed Origins Origins allowed to send requests. Use *to allow all origins.Allowed Methods HTTP methods the origins may use. Max Age Seconds How long the browser caches the CORS response. Advanced setting Expose Headers: response headers that client applications may read. Allowed Headers: headers allowed in Access-Control-Request-Headers. -
Save the rule. It appears in the Bucket CORS tab.
Edit a CORS rule
- Click Edit for the rule.
- Change the settings and save.
Delete a CORS rule
- Click Delete for the rule.
- In the confirmation dialog, check the rule name and click Delete.