aws-samples / amazon-cloudfront-secure-static-site

Create a secure static website with CloudFront for your registered domain.
Apache License 2.0
385 stars 140 forks source link

How to update static files? #70

Open pnx472 opened 7 months ago

pnx472 commented 7 months ago

Hi,

I'm not sure what's the workflow to update static file or index.html after successful deployment with "aws cloudformation package ... && aws cloudformation deploy ...".

Let's say we would like to update the h1 tag of index.html.

It looks like the code in lambda function is updated but the handler from layer is not invoked to copy the files to s3 bucket.

Am I missing something?

ramirezj commented 1 day ago

Stumbled over the same issue and the following worked for me:

  1. Push your static files to the bucket in S3, either via aws sync or the console
  2. Deploy the packaged CloudFormation stack, repackaging if necessary, to trigger the CopyFunction
  3. Invalidate the CloudFront Distribution