- Published on
FREE - Automate hosting static site on S3 + Cloudfront using Terraform
- Authors
- Name
- Minh LK
Terraform boilerplate for S3 + CloudFront
Progress?
- Init infrastructure of Cloudfront + S3 Origin using Terraform
- Github Next JS
- Auto deploy with buddy
Getting Started
Prerequisites
Terraform CLI
Installation
- Install Terraform CLI
- Create User
Terraform
with S3/CloudFront permission usingAWS IAM console
- Copy access_key and secret_key from AWS to ~/.aws/credentials file
File ~/.aws/credentials
[terraform]
aws_access_key_id = yyyyyyyyyyyyyy
aws_secret_access_key = xxxxxxxxxxxxxxx
region=ap-northeast-1
- Change bucket name
simple-blog
to an unique name - Deploy to aws using TF CLI
terraform init
terraform deploy
- Clean up after using
terraform destroy