1

I'm using s3cmd in my CI/CD deploy pipeline. My files are uploaded to a bucket in S3, which is then internet-accesible from CloudFront.

After reading AWS's docs carefully, I understand that CloudFront will cache, by default, all files from S3, which means that if I modify a file in S3, changes won't get immediately reflected in CloudFront.

This being said, after also reading s3cmd's docs, I found that I can issue an invalidation request for my index.html file using the --cf-invalidate-default-index parameter.

I tried to modify my index.html and then I ran again my CI/CD pipeline, this time using that invalidation parameter and then I went to my AWS console -> CloudFront -> selected my distribution -> "Invalidations" tabs and there wasn't anything there. Also, CloudFront is still returning my old index.html.

So at this point I'm not really sure if I understand correctly the entire invalidation concept, or if just s3cmd has a bug.

Which one is it? Also, how can I immediately reflect changes to my index.html?

alexandernst
  • 14,352
  • 22
  • 97
  • 197

0 Answers0