Search code examples
amazon-web-servicesamazon-s3amazon-cloudfrontaws-cli

Undo invalidation AWS Cloudfront


I have deployed a static website in S3 through cloudfront. I did some updates and through google found a way to clear the cloudfront cache by running: aws cloudfront create-invalidation --distribution-id XXXXX --paths "/*"

But now whenever I visit my url the website prompts me to download the targeted index.html. Instead of showing it. Hence, the invalidation I did, performed something that I do no understand and would like to undo this effect and simply accept that it takes 24 hours for changes to go live.

What can I do to undo this invalidation and how an I restore my website?


Solution

  • My misstake, it had nothing to do with cloudfront. I found the answer here: AWS Content Type Settings in S3 Using Boto3

    I uploaded the file using boto3 and didn't set the ContentType, hence s3 didn't know how to interpret this new file which was uploaded.