s3-cloudfront

hahuang65/s3-cloudfront/module

Terraform Module HCL MODULE

Terraform module which creates a CloudFront-enabled S3 bucket for static website hosting.

Install
module "s3-cloudfront" {
source = "hahuang65/s3-cloudfront/module"
version = "1.2.0"
}
plain text: /constructs/tfmod-hahuang65-s3-cloudfront-module/install.txt
⭐ Source on GitHub 📦 Registry page
README

AWS S3/CloudFront Website Terraform Module This is a Terraform module which creates CloudFont-enabled S3 bucket for a static website with logging and object life-cycle management. Important This module will create an encrypted (i.e. HTTPS) endpoint in CloudFront using Amazon Certificate Manager. ACM cannot be automated at this time as it requires manual steps in the approval of the domain name before it can be added into the account. Please therefore setup the certificate for the domain name you require (and any aliases you may include as well) by following the Getting Started guide in the AWS Documentation. Usage ``hcl provider "aws" { region = "eu-west-2" } module "website" { source = "modules/terraform-module-s3-cloudfront" name = "my-first-website" hostname = "example.com" wildcard_ssl

Inputs (13)
NameTypeDescriptionDefault
aliaseslistAdditional aliases to host this website for.[]
price_classstringWhich price_class to enable in CloudFront."PriceClass_100"
namestringName to give this environment."example"
hostnamestringHostname for this website."example.com"
cache_ttlstringDefault TTL to give objects requested from S3 in CloudFront for caching.3600
logs_transition_iastringHow long to wait before transitioning log files into S3-IA.30
index_documentstringDefault index document for directories and website root."index.html"
error_documentstringDefault html document to display for errors (e.g. 404)."error.html"
tagsmapA map of tags (in addition to Name) to add to all resources.{}
force_destroystringA boolean that indicates all objects should be deleted from the bucket so that tfalse
wildcard_sslstringWildcard SSL certificate domain name. E.g. *.example.com""
logs_transition_glacierstringHow long to wait before transitioning log files into Glacier.60
logs_expirationstringHow long to wait before deleting old log files.365
Outputs (6)
hostname — The URL for the Website.
s3_bucket_name — The name of the S3 content bucket to upload the website content to.
s3_logging_name — The name of the S3 logging bucket that access logs will be saved to.
cloudfront_distribution_id — The ID of the CloudFront Distribution.
cloudfront_distribution_hostname — The hostname of the CloudFront Distribution (use for DNS CNAME).
cloudfront_zone_id — The Zone ID of the CloudFront Distribution (use for DNS Alias).
Resources (4)
aws_cloudfront_distributionaws_cloudfront_origin_access_identityaws_s3_bucketaws_s3_bucket_policy
Details
FrameworkTerraform Module
LanguageHCL
Version1.2.0
Cloud MODULE
★ Stars0
Forks0
Total downloads794
Inputs13
Outputs6
Resources4
Examples3
LicenseMIT
Namespacehahuang65
Updated