Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconmodules
file-type-icon_docs
file-type-icons3-cloudfront
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-icons3-static-website
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md

Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconmodules
file-type-icon_docs
file-type-icons3-cloudfront
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-icons3-static-website
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
CloudFront

CloudFront

Deploy CloudFront as a CDN in front of your S3 bucket. Supports cache settings, Route 53 DNS entries, and TLS certs.

Code Preview

Preview the Code

mobile file icon

vars.tf

down
  • # ---------------------------------------------------------------------------------------------------------------------
  • # REQUIRED MODULE PARAMETERS
  • # These variables must be passed in by the operator.
  • # ---------------------------------------------------------------------------------------------------------------------
  • variable "bucket_name" {
  • description = "The name of the S3 bucket."
  • type = string
  • }
  • variable "s3_bucket_is_public_website" {
  • description = "Set to true if your S3 bucket is configured as a website and publicly accessible. Set to false if it's a regular S3 bucket and only privately accessible to CloudFront. If it's a public website, you can use all the S3 website features (e.g. routing, error pages), but users can bypass CloudFront and talk to S3 directly. If it's a private S3 bucket, users can only reach it via CloudFront, but you don't get all the website features."
  • type = string
  • }
  • variable "index_document" {
  • description = "The path that you want CloudFront to query on the origin server when an end user requests the root URL (e.g. index.html)."
  • type = string
  • }
  • variable "default_ttl" {
  • description = "The default amount of time, in seconds, that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an 'Cache-Control max-age' or 'Expires' header."
  • type = number
  • }

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?