How to create AWS S3 versioning buckets
Estimated time to read: 2 minutes
In this tutorial, you're going to learn how to setup S3 versioning in OpenStack with Fuga Cloud
Prerequisites:
- Log in to the Dashboard
- Dashboard -> Access -> Credentials
- Open the tab: “EC2 / S3 Credentials”
- Request new ones or use one you already have
How to install AWS CLI
Using pip3 to install AWS CLI
Configure the AWS CLIThe next step is to create a profile that communicates with de S3 API. You can give the profile any name you like. In this example, 'Fuga' is used.
$ aws configure --profile=fuga
AWS Access Key ID [None]: <access id>
AWS Secret Access [None]: <secret>
Default region name [None]: <press enter>
Default output format [None]: <press enter>
Create a bucket
With the following command you create a bucket:
List your buckets
To list all your buckets, just use:
{
"Buckets": [
{
"Name": "test",
"CreationDate": "2021-10-20T12:34:37.650Z"
},
{
"Name": "versioned",
"CreationDate": "2021-11-30T09:15:20.298Z"
}
],
"Owner": {
"DisplayName": "owner name",
"ID": "owner ID."
}
}
Enable versioning for the S3 bucket:
$ aws --profile=fuga --endpoint=https://core.fuga.cloud:8080 s3api put-bucket-versioning --bucket versioned --versioning-configuration Status=Enabled
$ aws --profile=fuga --endpoint=https://core.fuga.cloud:8080 s3api get-bucket-versioning --bucket versioned
Conclusion
In this tutorial, you learned how to set up an AWS S3 bucket with versioning enabled. In the next tutorial, you're going to learn how to create an AWS S3 versioning object.