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

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

Info required for witch file #59

Closed ammar-khan closed 1 year ago

ammar-khan commented 1 year ago

Appreciate the amazing example shared by the community and contributors

I need to ask a question about witch file which is used as lambda, but I am not able to get the purpose and why this file is required?

Also do you have a python alternate of this file?

Thanks

ConnorKirk commented 1 year ago

Hi Ammar, thanks for opening an issue.

The witch.js file defines a AWS CloudFormation Custom resource handler. This handler is executed when deploying the cloudformation template. The purpose of the custom resource is to upload the contents of the static site to the S3 Bucket.

Without this custom resource, the S3 bucket be empty when the CloudFormation template is deployed. The user would need to upload the static site to the S3 bucket manually.

The function traverses the /www directory and uploads each file to the S3 bucket specified. I don't have a python equivalent of this custom resource.

ammar-khan commented 1 year ago

Thanks @ConnorKirk

Really appreciate your timely and helpful response

Great resource and very helpful contributions by you all

IanLondon commented 10 months ago

Why is it called witch? :mage_woman: Is it an acronym or something, or is it just for fun?

ConnorKirk commented 9 months ago

@stilvoid has the authoritative answer

ConnorKirk commented 9 months ago

It stands for:

Website in the cloud. Help