Enabling or Disabling Bucket Versioning
You can enable object versioning in a bucket to create a new version of an object each time you modify it.
When bucket versioning is enabled, a version is created each time an object with the same name as another object contained in the bucket is uploaded, by you or by another user with the appropriate permissions. As buckets only store data, you cannot modify an object inside a bucket.
We recommend not exceeding 10 million versions, including delete markers, in a single bucket. |
You can download or delete any version of an object. For more information, see Downloading an Object from a Bucket and Removing Objects from a Bucket.
Enabling or Disabling Bucket Versioning Using AWS CLI
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
To enable or disable the versioning of a bucket, use the put-bucket-versioning command following this syntax:
$ aws s3api put-bucket-versioning \
--profile YOUR_PROFILE \
--bucket BUCKET \
--versioning-configuration Status=Enabled \
--endpoint https://oos.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
bucket
: The name of the bucket for which you want to enable or disable the versioning. -
versioning-configuration
: The configuration of the versioning. This element contains the following attribute you need to specify:-
Status
: The versioning state you want to apply to your bucket (Enabled
|Suspended
).
-
-
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The bucket versioning is enabled or disabled.
Related Pages
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.