How to create versioning buckets
Estimated time to read: 2 minutes
In this tutorial, you're going to learn how to set up versioning in OpenStack with Cyso 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 the API. You can give the profile any name you like. In this example, 'cyso-cloud' is used.
$ aws configure --profile=cyso-cloud
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:
$ aws --profile=cyso-cloud --endpoint=https://core.fuga.cloud:8080 s3api create-bucket --bucket versioned
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 bucket:
$ aws --profile=cyso-cloud --endpoint=https://core.fuga.cloud:8080 s3api put-bucket-versioning --bucket versioned --versioning-configuration Status=Enabled
$ aws --profile=cyso-cloud --endpoint=https://core.fuga.cloud:8080 s3api get-bucket-versioning --bucket versioned
Conclusion
In this tutorial, you learned how to set up a bucket with versioning enabled. In the next tutorial, you're going to learn how to create a versioning object.