website

buildo/website/aws

Terraform Module HCL AWS ⏱ stale 4y 4mo

Terraform module for creating static websites hosted on S3 and served via CloudFront

Install

module "website" {
source = "buildo/website/aws"
version = "2.0.0"
}
⭐ Source on GitHub 📦 Registry page

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)

NameTypeDescriptionDefault
domainstringThe domain where to host the site. This must be the naked domain, e.g. `example. required
enable_health_checkstringIf true, it creates a Route53 health check that monitors the www endpoint and anfalse
health_check_alarm_sns_topicslist(string)A list of SNS topics to notify whenever the health check fails or comes back to []
enable_gzipstringWhether to make CloudFront automatically compress content for web requests that true

Resources (5)

aws_cloudfront_distributionaws_cloudwatch_metric_alarmaws_route53_health_checkaws_route53_recordaws_s3_bucket

Details

FrameworkTerraform Module
LanguageHCL
Version2.0.0
Cloud AWS
★ Stars19
Forks6
Total downloads7.6k
Inputs4
Resources5
LicenseApache-2.0
Namespacebuildo
Updated