Static sites are commonplace, often I’ll knock something up as a proof of concept and to share that with my friends I’ll make a public s3 bucket and send the link, quick and easy. If I need/want this for a longer period of time I typically create a subdomain and point that to the bucket. In this example we will: Let’s stat the local setup: We are now ready to code.

This is very straightforward, remember when creating buckets that the bucket name should match the domain name you intend to point at the bucket. Be aware that although the removalPolicy is set to destroy, when deleting this stack this will fail unless you remove the files in the bucket.

Related Articles