Static site served via AWS s3+cloudfront

There is not need to run a 24/7 hosting on AWS.

You can upload your site to S3 and serve it via cloudfront.

This serverless already-made script does the job

https://github.com/serverless/examples/tree/master/aws-node-single-page-app-via-cloudfront

The spawnChilden didn’t work in node 12, but you can just change it to print the command. Add this to line 12 and comment the rest of the function

console.log(command + " " + args.join(" ") + ";\n");
return [null, null];
Once done, you can create a simple Route53 record to point to the cloudfront resource xxx.cloudfront.net to your domain.
It should be a CNAME, but Route53 seem to use a A record.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s