Is it possible to set a version name of a file in a s3 bucket?

Viewed 524

I have a current solution for my s3 bucket where I store exe files with specific versions like:

  • s3://my-bucket
    • /latest
      • my-exe-v1.xxx3.exe
    • /history
      • my-exe-v1.xxx2.exe
      • my-exe-v1.xxx1.exe
      • ...

Is it possible for versionned bucket to set the version name ? In my case it would allow to get the bucket like:

  • s3://my-bucket
    • my-exe.exe -> contains versions (v1.xxx1,v1.xxx2,v1.xxx3, ...)
1 Answers

S3 does not support naming a specific version. Instead it uses unique version IDs to differentiate among multiple versions of the same object. The main purpose of object versioning is to enable you to restore objects that are accidentally deleted or overwritten and compliance reasons.

Common practice to achieve what you want is to set versions as part of the objects' key, i.e., like a folder per version. For example, you could decide to have s3://my-bucket/V1/my-object and so on.

Beat, Stefan

Related