How do I enable versioning for an S3 bucket?


Introduction to Versioning

Spinup S3 buckets allow versioning of objects, which is disabled by default but can be enabled. Versioning creates separate versions of each object upon modification and retains the latest version even after deletion. This provides the flexibility to view or revert to any version but uses more storage as objects are never fully deleted. Versioning can be suspended, which only affects future changes, not existing versions. For more on S3 versioning, visit AWS's versioning documentation.

Manage via AWS CLI

  1. Check Versioning Status:

    aws s3api --profile spinup000123-mybucket get-bucket-versioning --bucket spinup000123-mybucket

    Look for "Status": "Suspended" or absence of status, indicating versioning is disabled.

  2. Enable Versioning:

    aws s3api --profile spinup000123-mybucket put-bucket-versioning --bucket spinup000123-mybucket --versioning-configuration Status=Enabled

     

  3. Disable Versioning:

    aws s3api --profile spinup000123-mybucket put-bucket-versioning --bucket spinup000123-mybucket --versioning-configuration Status=Suspended

     

  4. List All Versions: Use the following command to list all versions of an object:

     

Managing Versioning in Cyberduck

For a UI-based approach:

  1. Open Cyberduck and connect to your Spinup S3 bucket.

  2. Navigate to the desired bucket.

  3. Right-click the bucket and select 'Info' or 'Properties'.

  4. Find the Versioning section in the bucket properties.

  5. Enable versioning by changing the versioning status to 'Enabled'.

  6. Manage individual file versions by right-clicking on the file and selecting 'Show Versions'.

This process in Cyberduck allows you to visually manage and restore specific versions easily.

 


Related articles