Skip to content

A terraform module for creating a cloudfront distribution for static websites

Notifications You must be signed in to change notification settings

roylindauer/terraform-cloudfront-static-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Cloudfront Static Website

example usage:


terraform {
  required_version = ">= 0.14.5"

  backend "s3" {
    bucket = "your-state-bucket"
    key    = "terraform.tfstate"
    region = "us-west-1"

    # Force encryption
    encrypt = true
  }

  required_providers {
    aws = {
      version = "~> 4.12"
    }
  }
}

provider "aws" {
  region = "us-west-1"
}

provider "aws" {
  region = "us-east-1"
  alias  = "use1"
}

module "cloudfront_myapp" {
  source = "./cloudfront-static-website/"
  providers = {
    aws = aws.use1
  }
  domain = {
    zone   = "example.com"
    domain = "app.example.com"
  }
  domain_aliases = [{ "zone" : "example.app", "domain" : example.app" }]
  service        = "app"
  bucket         = "app.prod.example.com"
  acm_arn        = var.ssl_cert_cloudfront.acm_arn

  tags = { "Environment" = "prod", "Description" = "Managed by Terraform", "Creator" = "Terraform", "Name" = "Cloudfront - AMy App", }

}

About

A terraform module for creating a cloudfront distribution for static websites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages