In this tutorial, you're going to learn how to setup S3 versioning in OpenStack with Fuga Cloud
- 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
$ pip3 install awscli
Configure the AWS CLI
The 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>
With the following command you create a bucket:
$ aws --profile=fuga --endpoint=https://core.fuga.cloud:8080 s3api create-bucket --bucket versioned
To list all your buckets, just use:
$ aws --profile=fuga --endpoint=https://core.fuga.cloud:8080 s3api list-buckets
"DisplayName": "owner name",
"ID": "owner ID."
In the example shown above, you see the new bucket, you just created. There is another bucket, named test, that was already present.
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
Check that versioning is enabled:
$ aws --profile=fuga --endpoint=https://core.fuga.cloud:8080 s3api get-bucket-versioning --bucket versioned
In the example above, you see that versioning is enabled. It also shows that Multi-Factor Authentication (MFA) on deletion is disabled.
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.