s3-cloudfront
jonathanio/s3-cloudfront/module
Terraform module which creates a CloudFront-enabled S3 bucket for static website hosting.
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
| Name | Type | Description | Default |
|---|---|---|---|
| hostname | string | Hostname for this website. | "example.com" |
| logs_transition_ia | string | How long to wait before transitioning log files into S3-IA. | 30 |
| tags | map | A map of tags (in addition to Name) to add to all resources. | {} |
| force_destroy | string | A boolean that indicates all objects should be deleted from the bucket so that t | false |
| logs_expiration | string | How long to wait before deleting old log files. | 365 |
| price_class | string | Which price_class to enable in CloudFront. | "PriceClass_100" |
| index_document | string | Default index document for directories and website root. | "index.html" |
| name | string | Name to give this environment. | "example" |
| wildcard_ssl | string | Wildcard SSL certificate domain name. E.g. *.example.com | "" |
| aliases | list | Additional aliases to host this website for. | [] |
| cache_ttl | string | Default TTL to give objects requested from S3 in CloudFront for caching. | 3600 |
| logs_transition_glacier | string | How long to wait before transitioning log files into Glacier. | 60 |
| error_document | string | Default html document to display for errors (e.g. 404). | "error.html" |
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).