Terraform for S3 Static Website
This is a set of Terraform files to set up a static website in AWS. It makes use of the following resources:
- Certificate Manager
The end result is a website that supports:
- a primary and secondary domain (typically apex and www domains)
- redirect from secondary to primary
- Install Terraform
- Configure your AWS profile
git clone email@example.com:alimac/terraform-s3-static-website.git
You will be prompted to provide values for primary and secondary domain.
In addition to typing values at the prompt, you can create a
primary_domain = "example.com" secondary_domain = "www.example.com"
If AWS is not your domain registrar, you will need to set your domain's name servers to AWS name servers associated with your hosted zone. Terraform will output those automatically:
Outputs: name_servers = [ ns-1500.awsdns-59.org, ns-1595.awsdns-07.co.uk, ns-619.awsdns-13.net, ns-63.awsdns-07.com ]