From f4e06936a0df23707c16a8009a6180306b00aba0 Mon Sep 17 00:00:00 2001 From: anmolnagpal Date: Tue, 19 Jul 2022 21:16:18 +0530 Subject: [PATCH 1/2] made changes in cloudfront custom error response --- main.tf | 6 ++++-- variables.tf | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 76dea1c..de66f23 100644 --- a/main.tf +++ b/main.tf @@ -89,8 +89,10 @@ resource "aws_cloudfront_distribution" "bucket" { } custom_error_response { - error_code = var.error_code - response_page_path = var.response_page_path + error_caching_min_ttl = var.error_caching_min_ttl + error_code = var.error_code + response_code = var.response_code + response_page_path = var.response_page_path } tags = module.labels.tags diff --git a/variables.tf b/variables.tf index e1895e1..52ccbb1 100644 --- a/variables.tf +++ b/variables.tf @@ -243,13 +243,14 @@ variable "forward_cookies_whitelisted_names" { variable "error_code" { type = string - default = "404" + default = "403" description = "List of forwarded cookie names." } + variable "response_page_path" { type = string - default = null + default = "/index.html" description = "The path of the custom error page (for example, /custom_404.html)." } @@ -320,4 +321,18 @@ variable "cdn_enabled" { type = bool default = true description = "Select Enabled if you want to created CloudFront." +} + + +variable "response_code" { + type = string + default = "404" + description = "The path of the custom error page (for example, /custom_404.html)." +} + + +variable "error_caching_min_ttl" { + type = string + default = "10" + description = "The path of the custom error page (for example, /custom_404.html)." } \ No newline at end of file From 97e0eadadc886a939333a6f6fc5f6fb4fc753d93 Mon Sep 17 00:00:00 2001 From: anmolnagpal Date: Wed, 20 Jul 2022 15:25:15 +0530 Subject: [PATCH 2/2] made changes in cloudfront custom error response variable --- variables.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variables.tf b/variables.tf index 52ccbb1..2e234f7 100644 --- a/variables.tf +++ b/variables.tf @@ -327,12 +327,12 @@ variable "cdn_enabled" { variable "response_code" { type = string default = "404" - description = "The path of the custom error page (for example, /custom_404.html)." + description = "page not found code" } variable "error_caching_min_ttl" { type = string default = "10" - description = "The path of the custom error page (for example, /custom_404.html)." + description = "the value of errro caching min ttl" } \ No newline at end of file