# ============================================================================ # CloudFront Distribution Terraform Export # ============================================================================ # Generated from snapshot ID: 810 # Distribution ID: E3GQU9DAE9YX22 # Snapshot Timestamp: 2026-02-18T20:53:36.392478Z # Snapshot Age: 64 days # Retention Tier: weekly # Referenced in Changes: Yes # This snapshot is protected from deletion (referenced in changes) # ============================================================================ terraform { required_version = ">= 1.0" required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } } # ============================================================================ # Variables # ============================================================================ variable "distribution_comment" { description = "Comment/description for the CloudFront distribution" type = string default = "OWASP Juice Shop" } variable "distribution_enabled" { description = "Whether the distribution is enabled" type = bool default = true } variable "aliases" { description = "Domain aliases (CNAMEs) for the distribution" type = list(string) default = [] } variable "price_class" { description = "Price class for the distribution" type = string default = "PriceClass_All" } # ============================================================================ # Data Sources (Referenced Resources) # ============================================================================ # Cache Policy: 4135ea2d-6df8-44a3-9df3-4b5a84be39ad data "aws_cloudfront_cache_policy" "policy_4135ea2d" { id = "4135ea2d-6df8-44a3-9df3-4b5a84be39ad" } # Cache Policy: 83da9c7e-98b4-4e11-a168-04f0df8e2c65 data "aws_cloudfront_cache_policy" "policy_83da9c7e" { id = "83da9c7e-98b4-4e11-a168-04f0df8e2c65" } # ============================================================================ # CloudFront Functions # ============================================================================ resource "aws_cloudfront_function" "" { name = "" runtime = "cloudfront-js-1.0" publish = true # WARNING: Function code not available in snapshot code = "// Function code not exported" } resource "aws_cloudfront_function" "" { name = "" runtime = "cloudfront-js-1.0" publish = true # WARNING: Function code not available in snapshot code = "// Function code not exported" } # ============================================================================ # CloudFront Distribution # ============================================================================ resource "aws_cloudfront_distribution" "main" { enabled = var.distribution_enabled comment = var.distribution_comment price_class = var.price_class http_version = "http2" is_ipv6_enabled = true origin { domain_name = "ip-172-31-19-151.us-west-1.compute.internal" origin_id = "origin-ip-172-31-19-151.us-west-1.compute.internal-mlg52ichaq0" } default_cache_behavior { target_origin_id = "origin-ip-172-31-19-151.us-west-1.compute.internal-mlg52ichaq0" viewer_protocol_policy = "allow-all" allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] cached_methods = ["GET", "HEAD"] compress = true cache_policy_id = data.aws_cloudfront_cache_policy.policy_4135ea2d.id } ordered_cache_behavior { path_pattern = "/header" target_origin_id = "origin-ip-172-31-19-151.us-west-1.compute.internal-mlg52ichaq0" viewer_protocol_policy = "redirect-to-https" allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] cached_methods = ["GET", "HEAD"] compress = true cache_policy_id = data.aws_cloudfront_cache_policy.policy_83da9c7e.id } viewer_certificate { cloudfront_default_certificate = true } restrictions { geo_restriction { restriction_type = "none" } } tags = { Name = "CloudFront Distribution E3GQU9DAE9YX22" ManagedBy = "Terraform" SourceSnapshot = "E3GQU9DAE9YX22" } } # ============================================================================ # Outputs # ============================================================================ output "distribution_id" { description = "CloudFront distribution ID" value = aws_cloudfront_distribution.main.id } output "distribution_domain_name" { description = "CloudFront distribution domain name" value = aws_cloudfront_distribution.main.domain_name } output "distribution_arn" { description = "CloudFront distribution ARN" value = aws_cloudfront_distribution.main.arn }