resource "aws_cloudfront_distribution" "this" { count = var.enabled ? 1 : 0 comment = var.distribution_name enabled = true price_class = "PriceClass_100" tags = local.tags origin { domain_name = var.origin_domain origin_id = local.origin_id } default_cache_behavior { allowed_methods = ["GET", "HEAD", "OPTIONS"] cached_methods = ["GET", "HEAD"] target_origin_id = local.origin_id forwarded_values { query_string = false cookies { forward = "none" } } viewer_protocol_policy = "redirect-to-https" min_ttl = 0 default_ttl = 3600 max_ttl = 86400 } restrictions { geo_restriction { restriction_type = "none" } } viewer_certificate { cloudfront_default_certificate = true } }