website
buildo/website/aws
Terraform module for creating static websites hosted on S3 and served via CloudFront
Install
README
website Terraform module This is a Terraform module designed to automate the deploy of a static website. This modules creates the following resources: - two S3 buckets, one for the content (www.example.com), one for redirecting from the naked domain to www (named example.com) - two CloudFront distribution, one per bucket, that also redirect from HTTP to HTTPS - two Route53 alias records, one per CloudFront distribution Usage Prerequisites You have to create a SSL certificate for both domains (www and naked) on AWS. This step can't be automated, due to limitations of the AWS API. Follow this instructions: - Access the Certificate Manager on the AWS console - Switch to the us-east-1 (N. Virginia) region. - 🚨 This is CRUCIAL, as AWS requires certificates for CloudFront to be issued in this re
Inputs (4)
| Name | Type | Description | Default |
|---|---|---|---|
| domain | string | The domain where to host the site. This must be the naked domain, e.g. `example. | required |
| enable_health_check | string | If true, it creates a Route53 health check that monitors the www endpoint and an | false |
| health_check_alarm_sns_topics | list(string) | A list of SNS topics to notify whenever the health check fails or comes back to | [] |
| enable_gzip | string | Whether to make CloudFront automatically compress content for web requests that | true |