Amazon S3 Versioning Overview
Amazon S3 versioning is a feature that allows you to keep multiple versions of an object in the same bucket. Here's a summary of the key points covered in the training:
- Bucket-Level Setting: Versioning is enabled at the bucket level.
- File Version Creation: Every time a file is uploaded to a bucket with versioning enabled, a new version of that file is created at the specified key.
- Overwriting Files: If a file with the same key is uploaded again, S3 creates a new version (version two, three, etc.) instead of overwriting the existing file.
- Best Practice: It is considered a best practice to enable versioning on your S3 buckets to protect against unintended deletions or to roll back to previous versions of files.
Advantages of Versioning
- Protection Against Deletion: If a file version is deleted, a delete marker is placed, which allows you to restore previous versions.
- Rollback Capability: You can easily roll back to previous versions of files, such as the version from two days ago.
Important Notes
- Null Version: Files that are not versioned prior to enabling versioning will have a version ID of null.
- Suspending Versioning: Suspending versioning does not delete the previous versions of files; it's a non-destructive operation.
Action Steps
- Enable versioning on your desired S3 bucket.
- Upload files to the bucket to create initial versions.
- Re-upload files with the same key to create additional versions.
- Use the S3 console to manage and restore previous file versions as needed.
Now, let's head to the AWS console to explore how to use versioning in practice.