3

In aws s3 versioning enabled buckets we can upload same name objects, it preserved in buckets with version Id. If i upload 10 versions in a bucket the latest version is which was i upload last.

If i want to make my 4th version as latest version, one way to do this removing all latest 6 versions it automatically change the 4th version as a latest version.

Another way is re upload a version 4 , it takes as 11th version & also it is a latest version. We upload a existing object with its old version ID.

How we can do the second way in AWS command line interface ?

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
Arun Kumar
  • 495
  • 9
  • 29
  • You should provide the commands you have tried in amazon cli and the errors or output you get. Please edit your original question – Spangen Nov 14 '17 at 12:09
  • i am sorry, i don't know the command to do this in CLI, I searched but could not find – Arun Kumar Nov 14 '17 at 12:11

1 Answers1

0

I found Solution to re upload object with its older version Id. "copy-object" command can be used.

aws s3api copy-object --bucket YOUR BUCKET--key img.jpg --copy-source "YOUR BUCKET/img.jpg?versionId=fRP7UzABrXTsBgBu9WAhZ0VgU3pif9Lp" --acl public-read

it copy the old version as new version ...

Arun Kumar
  • 495
  • 9
  • 29