This guide is for advanced users with intricate knowledge of AWS and its services. If you're new to static sites you can try out Netlify they're a super simple way to deploy static sites. If you're asking why do it at all, its for bonus cool points.
Here are the steps of how to deploy it:
Feel free to skip ahead to anything you've already done.
You can use any of the following services to maintain your code
Once you have all your code commited and ready, move on to the next step.
AWS CodePipeline is a tool that looks for commits and pulls made to a git repository and triggers an action on the code. Action may be postprocessing of data, building container images, exporting static files and so on.
Click on next
One you choose your source, AWS will ask you to connect your repo to the pipeline. Provide all necessary permissions. Click Next.
Button is located at the bottom of the page
Skipping build stage implies that you already have deployable
index.htmlin your git repo. If you do not consider using a build stage.
Choose any of your S3 buckets
Check the Extract file before deploy option
Click on the pipeline you just created and view its history. If the trigger has been setup correctly, here's what you'll see.
Cloudfront is AWS CDN service that can serve objects from globally cached edge nodes. It can be used to serve images, css, html, php and all static assets. Video Livestreaming is also possible.
Use the Origin Path option to make sure you serve the right files. Here's an example of what it looks like:
If you want a custom domain, AWS automatically provisions a SSL certificate.
Now you must have a cloudfront domain deployed at your custom domain
Here's how the Cloufront Distrubution looks once its done!
Poorna's blog 2020-PRESENT. All the opinions on this blog are opinions only. I have no sponsors and I am not affliated with any platforms or ventures.