In this article, I will see how to host “zackweb” as a static web application using bellow AWS serverless options:
S3 static webhosting
AWS CDK + CloudFront
Prerequisite
Add one more step in existing Github Action workflow to copy the static web content to newly created S3 bucket
Option 1: S3 static webhosting
Go AWS console, under S3 bucket “zackweb-serverless” properties, enable static website hosting, update the bucket website endpoint address to Godaddy DNS record.
Option 2: using AWS CDK + CDN
With AWS CDK and CDN, the “zackweb” can be straightforward distributed from an S3 bucket accessible to the public by using CloudFront.
the steps will be:
Enable AWS CDK on EC2 bastion host.
S3 bucker ready and copy static web content into it (done above with modification of existing github action workflow)
Establish a CloudFront distribution to host a static To-Do web application.
Deploy the AWS CDK solution to host the To-do application.
install AWS CDK on bastion EC2 host
The “zackweb” is now hosted on the AWS with serverless deployment !
Conclusion
Now we move the blog onto AWS with serverless website hosting, using both S3 static webhosting and AWS CDK plus Cloudfront.