An object version is a distinct stored revision of an object identified by the same object key. S3 disables versioning for buckets by default: uploading new data under an existing key replaces the previously accessible data. Enabling versioning preserves earlier revisions for retrieval. section 7.3
Use AWS CLI commands to preserve and inspect revisions:
- Enable versioning with aws s3api put-bucket-versioning and Status=Enabled. section 7.3
- List stored objects and their versions with aws s3api list-object-versions. section 7.3
- Download all versions to restore earlier data. section 7.3
Preserving successive uploads
Upload data 1 under key A, then upload data 2 under the same key. Without versioning, downloading A returns data 2 and data 1 is no longer accessible. With versioning enabled, both revisions remain available. This supports backup and archiving, but each new version increases billable bucket size. section 7.3
Enable versioning on a named S3 bucket with the AWS CLI. section 7.3
$ aws s3api list-object-versions --bucket awsinaction-$yourname
Inspect all objects and stored revisions in the bucket. section 7.3




