Object version ID
An object version ID is a service-assigned identifier used with a bucket and key to select an S3 object version.
Scope: S3 general-purpose buckets. Generated S3 IDs are opaque, not chronological counters or checksums. A version can also be a delete marker rather than data. The literal null ID is a special case: a same-key write while versioning is suspended can replace that version's contents without changing its ID. [1] [2]
ListObjectsV2 does not return VersionId. ListObjectVersions lists retained versions and delete markers; it requires s3:ListBucketVersions permission and is not supported for directory buckets. [6] [7]
For ListObjectVersions with IsTruncated=true, continue with the returned NextKeyMarker and NextVersionIdMarker as key-marker and version-id-marker. Use this marker pair, not the ListObjectsV2 continuation token. [7]
Relations
Advantages
- An explicit versionId selects a retained revision for GET even when it is not current, subject to s3:GetObjectVersion permission. [4]
Limitations
- Existing objects retain null IDs when versioning is first enabled; generated version IDs are not retroactively assigned. [1]
- A version identifier does not prevent an authorized permanent deletion of that version. [3]
- A checksum must still be verified separately; selecting a version is not proof that downloaded bytes match the expected data. [4]
Citations
- Amazon S3: How S3 Versioning works, version IDs
- Amazon S3: Adding objects to versioning-suspended buckets
- Amazon S3 API: DeleteObject, versioning-dependent effects
- Amazon S3 API: GetObject, version selection and checksum fields
- Amazon S3 API: ListObjectsV2, response encoding and fields
- Amazon S3 API: ListObjectVersions, version identities and permissions