Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS S3 website versioning

I am running a website on AWS S3 bucket. I have to update the website once in a while. At the moment, when I do the deployment I just copy the built files to my bucket and override existing ones.

Is there a way to do some versioning on these deployments? I know there is a built-in versioning S3, but it is only for individual files I think.

The best option would be that every deployment is tagged with git commit-id and I could rollback to a particular commit-id if needed.

Any ideas? Already tried to name directories with commit-id -prefix, but the problem is that index.html has to live in root dir.

like image 615
ikenator Avatar asked Aug 19 '16 11:08

ikenator


People also ask

Does S3 have versioning?

Versioning in Amazon S3 is a means of keeping multiple variants of an object in the same bucket. You can use the S3 Versioning feature to preserve, retrieve, and restore every version of every object stored in your buckets.

Is S3 versioning incremental?

Versioning in AWS S3 can be described simply as keeping incremental copies of the same file as you make modifications. In S3 versioning stores, all versions of an object and including all write even if you delete an object. S3 versioning is a great back up tool.


1 Answers

If you want to use some solution for non-technical users who could rollback the previous version just by doing some clicking action in AWS console you can try to change Index document config.

For example, you have structure in bucket like this:

  • bucket/v1/index.html
  • bucket/v2/index.html
  • ...
  • bucket/vN/index.html

It means, that you could only change the config in Bucket properties -> Static website hosting -> Index document -> from v2/index.html to v1/index.html.

Sounds like "just doing some clicking action in AWS console"

like image 191
anton.uspehov Avatar answered Sep 28 '22 08:09

anton.uspehov