Below you will find pages that utilize the taxonomy term “Terraform”
Static website hosting using S3 and CloudFront
A note on dates: this post was written in 2020 using Terraform 0.12 and the
nodejs12.xLambda runtime. The architecture still holds up well, but if you’re following along today, check the current AWS provider docs and use a supported Lambda runtime and Terraform version. In particular, theaws_s3_bucketresource has since been split into smaller resources (aws_s3_bucket_acl,aws_s3_bucket_logging,aws_s3_bucket_website_configurationand so on).
Recently I had the chance to create a static website using S3 and CloudFront. I used Hugo as the framework for content management and Terraform to provision the infrastructure. There were a few interesting challenges, but in the end it worked out well.