Skip to content

Auto-generated

This page is generated by terraform-docs at build time from the infra/ repo. Do not edit manually.

Edge CDN

CloudFront distribution for static asset delivery and edge compute. Serves files from the CDN S3 bucket with OAC, CORS headers, and client-side caching (24h). Includes two Lambda@Edge functions: /region for geo-based consent region lookup and /log for consent event ingestion via SQS. Logging uses CloudFront Standard Logging v2 with w3c format and date-partitioned S3 delivery.

Requirements

Name Version
terraform >= 1.6.0
archive ~> 2.0
aws ~> 5.0
local ~> 2.0

Providers

Name Version
archive ~> 2.0
aws ~> 5.0
aws.us_east_1 ~> 5.0
local ~> 2.0

Modules

No modules.

Resources

Name Type
aws_cloudfront_cache_policy.cdn resource
aws_cloudfront_distribution.cdn resource
aws_cloudfront_origin_access_control.cdn resource
aws_cloudfront_origin_request_policy.lambda_edge resource
aws_cloudfront_response_headers_policy.cdn resource
aws_cloudwatch_log_delivery.cdn resource
aws_cloudwatch_log_delivery_destination.cdn resource
aws_cloudwatch_log_delivery_source.cdn resource
aws_iam_role.lambda_log resource
aws_iam_role.lambda_region resource
aws_iam_role_policy.lambda_log_sqs resource
aws_iam_role_policy_attachment.lambda_log_basic resource
aws_iam_role_policy_attachment.lambda_region_basic resource
aws_lambda_function.log resource
aws_lambda_function.region resource
aws_route53_record.cdn resource
local_file.lambda_log_source resource
archive_file.lambda_log data source
archive_file.lambda_region data source
aws_cloudfront_cache_policy.disabled data source
aws_iam_policy_document.cdn_oac data source
aws_iam_policy_document.lambda_edge_assume data source

Inputs

Name Description Type Default Required
base_tags Base tags to apply to all resources map(string) {} no
certificate_arn ARN of the ACM certificate (must be in us-east-1) string n/a yes
hostname Public-facing domain for the CDN (e.g. cdn.stage.cookiehub.net) string n/a yes
name_prefix Prefix for resource names string n/a yes
s3_cdn_bucket_arn ARN of the CDN S3 bucket string n/a yes
s3_cdn_bucket_id ID of the CDN S3 bucket string n/a yes
s3_cdn_bucket_regional_domain_name Regional domain name of the CDN S3 bucket string n/a yes
s3_cdn_logs_bucket_arn ARN of the CDN logs S3 bucket string n/a yes
sqs_queue_arn ARN of the consent SQS queue (for IAM permissions) string n/a yes
sqs_queue_url URL of the consent SQS queue (injected into the log Lambda) string n/a yes
sqs_region AWS region of the SQS queue string n/a yes
zone_id Route53 hosted zone ID for the hostname string n/a yes

Outputs

Name Description
distribution_domain_name CloudFront distribution domain name
distribution_id CloudFront distribution ID
oac_bucket_policy_json Bucket policy JSON to allow CloudFront OAC access to the CDN S3 bucket