Skip to content

Commit

Permalink
infra: cloudfront (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio authored Nov 26, 2024
1 parent 990536c commit 4f457c7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions terraform/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ resource "aws_cloudfront_distribution" "main" {
viewer_protocol_policy = "redirect-to-https"
compress = true

cache_policy_id = "4135ea2d-6df8-44a3-9df3-4b5a84be39ad" #Managed-CachingDisabled
# cache_policy_id = "4135ea2d-6df8-44a3-9df3-4b5a84be39ad" #Managed-CachingDisabled
cache_policy_id = aws_cloudfront_cache_policy.default.id
origin_request_policy_id = aws_cloudfront_origin_request_policy.admin.id

function_association {
Expand All @@ -114,9 +115,9 @@ resource "aws_cloudfront_distribution" "main" {

resource "aws_cloudfront_cache_policy" "default" {
name = "${local.namespace}-cache-policy"
min_ttl = 60
default_ttl = 60
max_ttl = 60
min_ttl = 3600
default_ttl = 3600
max_ttl = 3600

parameters_in_cache_key_and_forwarded_to_origin {
enable_accept_encoding_brotli = true
Expand Down

0 comments on commit 4f457c7

Please sign in to comment.