Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.64 KB

README.md

File metadata and controls

68 lines (49 loc) · 1.64 KB

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

provider "aws" {
  region = "eu-west-2"
}

module "website" {
  source = "modules/terraform-module-s3-cloudfront"

  name         = "my-first-website"
  hostname     = "example.com"
  wildcard_ssl = "*.example.com"
  
  aliases  = [
  	"example.net",
  	"example.org"
  ]

  cache_ttl = 86400

  logs_transition_ia      = 30
  logs_transition_glacier = 60
  logs_expiration         = 365

  price_class = "PriceClass_100"

  index_document = "index.html"
  error_document = "error.html"

  tags {
    Domain = "example.com"
    Owner  = "[email protected]"
  }
}

Examples

A simple example of how to use this module can be found in the examples/ directory of this repository.

Authors

Jonathan Wright [email protected] Dave Dash [email protected]

License

MIT Licensed. See LICENSE for full details.