You should have a look at AWS Amplify Console <a href="https://aws.amazon.com/amplify/console/" rel="nofollow">https://aws.amazon.com/amplify/console/</a>
It’s specifically designed to do most of this for you. I’ve been using it for static site work recently and it’s awesome. It also does plenty more and can be used for full stack dev but it’s great if you just need static site hosting and build pipelines. No need to have the build locally and uses gitops for build and auto generates environments based off branch name patterns.
If it's just a personal website, you might find it easier to use GitHub Pages (or GitLab's equivalent) and Cloudflare. Both are free for any reasonable personal website usage.<p>If you don't want to run a build of your static site generator on your computer and upload the result to GitHub every time you make a change, you can just use Jekyll and GitHub will build it for you. I think GitLab supports other static site generators as well. This technique is how <a href="https://www.snazz.xyz" rel="nofollow">https://www.snazz.xyz</a> works.
I've always wondered why Amazon's own CodePipeline service could not deploy a commit of a HTML/CSS static sites straight to S3. They can deploy from CodeCommit straight to Elastic Beanstalk easily enough, but for years I have been asking for an S3 bucket as a destination which would make deploying our static website a piece of cake.<p>As it is, we have had to use BitBucket as the repo for our website, and we use the Pipelines feature on there to deploy to S3. Would be nice not to have to use a third party service to do something that AWS's own infrastructure makes unreasonably complex and difficult.
Configuring CORS is probably the biggest pain about this approach and is necessary if you want to send data to and from an API. This guide should probably mention it or link another guide.
If you want to do this with one command, check out <a href="https://github.com/tobilg/serverless-aws-static-websites" rel="nofollow">https://github.com/tobilg/serverless-aws-static-websites</a> or, if you want to host an API with Lambda as well, <a href="https://github.com/tobilg/aws-fullstack-website" rel="nofollow">https://github.com/tobilg/aws-fullstack-website</a>
I just use s3_website. It works well if you have Java installed.<p><a href="https://github.com/laurilehmijoki/s3_website" rel="nofollow">https://github.com/laurilehmijoki/s3_website</a>