From 73fe0d49cb37d23d98ad271f922f620e3c1e4fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20J=C3=BAnior=20do=20Nascimento=20Lima?= Date: Mon, 15 Mar 2021 11:49:25 -0300 Subject: [PATCH] Add var to apply default behavior on forward-query-strings --- site-redirect/main.tf | 2 +- site-redirect/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/site-redirect/main.tf b/site-redirect/main.tf index 70ec8fa..3e37e72 100644 --- a/site-redirect/main.tf +++ b/site-redirect/main.tf @@ -116,7 +116,7 @@ resource "aws_cloudfront_distribution" "website_cdn" { cached_methods = ["GET", "HEAD"] forwarded_values { - query_string = false + query_string = var.forward-query-string cookies { forward = "none" diff --git a/site-redirect/variables.tf b/site-redirect/variables.tf index e3eafe2..0197491 100644 --- a/site-redirect/variables.tf +++ b/site-redirect/variables.tf @@ -40,3 +40,9 @@ variable "default_root_object" { description = "CloudFront default root object" default = "index.html" } + +variable "forward-query-string" { + type = bool + description = "Forward the query string to the origin" + default = true +} \ No newline at end of file