From 0a37dd2a94fc8e27e15470ea9b8e582486f71d90 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Thu, 22 Jun 2023 11:35:08 +0100 Subject: [PATCH] Remove redundant reframe routing from cloudfront cid.contact no longer supports reframe paths. Remove caching config for it. --- .../dev/us-east-2/cloudfront.tf | 35 ------------------ .../prod/us-east-2/cloudfront.tf | 36 ------------------- 2 files changed, 71 deletions(-) diff --git a/deploy/infrastructure/dev/us-east-2/cloudfront.tf b/deploy/infrastructure/dev/us-east-2/cloudfront.tf index ceb6a1f62..0d8a4e063 100644 --- a/deploy/infrastructure/dev/us-east-2/cloudfront.tf +++ b/deploy/infrastructure/dev/us-east-2/cloudfront.tf @@ -67,16 +67,6 @@ resource "aws_cloudfront_distribution" "cdn" { viewer_protocol_policy = "redirect-to-https" } - ordered_cache_behavior { - path_pattern = "reframe" - # CloudFront does not support configuring allowed methods selectively. - # Hence the complete method list. - allowed_methods = ["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "PATCH", "POST"] - cached_methods = ["GET", "HEAD", "OPTIONS"] - target_origin_id = local.indexstar_origin_id - cache_policy_id = aws_cloudfront_cache_policy.reframe.id - viewer_protocol_policy = "redirect-to-https" - } ordered_cache_behavior { path_pattern = "ingest/*" @@ -161,31 +151,6 @@ module "records" { ] } -resource "aws_cloudfront_cache_policy" "reframe" { - name = "${local.environment_name}_reframe" - - # We have to set non-zero TTL values because otherwise CloudFront won't let - # the query strings settings to be configured. - min_ttl = 0 - default_ttl = 3600 - max_ttl = 86400 - - parameters_in_cache_key_and_forwarded_to_origin { - cookies_config { - cookie_behavior = "none" - } - headers_config { - header_behavior = "none" - } - query_strings_config { - query_string_behavior = "all" - } - - enable_accept_encoding_brotli = true - enable_accept_encoding_gzip = true - } -} - resource "aws_cloudfront_cache_policy" "lookup" { name = "${local.environment_name}_lookup" diff --git a/deploy/infrastructure/prod/us-east-2/cloudfront.tf b/deploy/infrastructure/prod/us-east-2/cloudfront.tf index 7e4e5dd24..77085e4a8 100644 --- a/deploy/infrastructure/prod/us-east-2/cloudfront.tf +++ b/deploy/infrastructure/prod/us-east-2/cloudfront.tf @@ -99,17 +99,6 @@ resource "aws_cloudfront_distribution" "cdn" { max_ttl = 86400 } - ordered_cache_behavior { - path_pattern = "reframe" - # CloudFront does not support configuring allowed methods selectively. - # Hence the complete method list. - allowed_methods = ["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "PATCH", "POST"] - cached_methods = ["GET", "HEAD", "OPTIONS"] - target_origin_id = local.indexstar_origin_id - cache_policy_id = aws_cloudfront_cache_policy.reframe.id - viewer_protocol_policy = "redirect-to-https" - } - ordered_cache_behavior { path_pattern = "multihash/*" # CloudFront does not support configuring allowed methods selectively. @@ -183,31 +172,6 @@ resource "aws_cloudfront_distribution" "cdn" { } } -resource "aws_cloudfront_cache_policy" "reframe" { - name = "reframe" - - # We have to set non-zero TTL values because otherwise CloudFront won't let - # the query strings settings to be configured. - min_ttl = 0 - default_ttl = 3600 - max_ttl = 86400 - - parameters_in_cache_key_and_forwarded_to_origin { - cookies_config { - cookie_behavior = "none" - } - headers_config { - header_behavior = "none" - } - query_strings_config { - query_string_behavior = "all" - } - - enable_accept_encoding_brotli = true - enable_accept_encoding_gzip = true - } -} - resource "aws_cloudfront_cache_policy" "lookup" { name = "lookup"