github cookielab/terraform-aws-static-site 3.4.0

latest releases: 4.4.0, 4.3.1, 4.3.0...
7 months ago

Feat

Add possibilty assign custom cloudfront function.

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

resource "aws_cloudfront_function" "static_site_request" {
  name    = "static-site-request"
  runtime = "cloudfront-js-2.0"
  code    = file("${path.module}/resources/static-site-request.js")
  publish = true
}

module "static-site" {
  source  = "cookielab/static-site/aws"
  version = "~> 3.4"

  providers = {
    aws.us_east_1 = aws.us_east_1
  }

  domains        = ["www.example.com"]
  domain_zone_id = aws_route53_zone.example_com.zone_id
  s3_bucket_name = "example_com_web"

  functions = {
    viewer_request = aws_cloudfront_function.static_site_request.arn
  }
}

Don't miss a new terraform-aws-static-site release

NewReleases is sending notifications on new releases.