cloudfront
anttiviljami/cloudfront/protected
Terraform module to create a CloudFront distribution with HTTPS and IP protection
terraform-protected-cloudfront   !Version Terraform module to create a CloudFront distribution with HTTPS and IP protection adhering to AWS best practices. This module creates: - Cloudfront Distribution - Fully configurable default origin - TLS with existing ACM Certificate - Private S3 bucket served under /static - WAF Web ACL for IP protection - Route53 HostedZone + ALIAS records for configured domains Usage ``hcl module "protected_cloudfront" { source "git::https://github.com/anttiviljami/terraform-protected-cloudfront.git?ref=tags/1.1.2" name = "my-protected-app" root_domain = "terraform.viljami.io
| Name | Type | Description | Default |
|---|---|---|---|
| name | string | Distribution name | required |
| forwarded_headers | list(string) | Headers to forward to default origin | [
"Authorization",
"Referrer"
] |
| static_path | string | The root path of the static endpoint | "/static" |
| root_domain | string | Root domain for Route53 Hosted Zone in FQDN format | "" |
| subdomains | list(string) | Subdomains associated with ACM certificate in FQDN format | [] |
| default_origin | object({ domain_name = str | The default distribution behaviour | {
"custom_origin_config": {
"http_ |
| allowlist_ipv6 | list(string) | IPv6 CIDR ranges allowed to access the distribution | [] |
| tags | map(string) | Tags to assign to resources | {} |
| acm_certificate_arn | string | ACM Certificate ARN for HTTPS | "" |
| allowlist_ipv4 | list(string) | IPv4 CIDR ranges allowed to access the distribution | [] |
| minimum_tls_version | string | The minimum TLS version supported for viewers | "TLSv1.1_2016" |
| price_class | string | The price class of the CloudFront distribution | "PriceClass_100" |
static_bucket — Name of S3 bucket serving /staticstatic_bucket_arn — ARN of S3 bucket serving /staticdistribution_arn — CloudFront Distribution ARNdistribution_id — CloudFront Distribution IDdistribution_domain_name — CloudFront Distribution Domain Name