From abcd2dac0c0e81ca510135ea87a1f9991f152b30 Mon Sep 17 00:00:00 2001 From: mmgcarlos Date: Thu, 6 Apr 2023 09:43:09 +0100 Subject: [PATCH] Making domain no prefix a list --- modules/fastly-frontend/main.tf | 2 +- modules/fastly-frontend/variables.tf | 6 +++--- variables.tf | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/fastly-frontend/main.tf b/modules/fastly-frontend/main.tf index 9ab7009..1c5906e 100644 --- a/modules/fastly-frontend/main.tf +++ b/modules/fastly-frontend/main.tf @@ -23,7 +23,7 @@ resource "fastly_service_v1" "fastly" { } dynamic "domain" { - for_each = (var.domain_no_prefix == "" ? [] : [var.domain_no_prefix]) + for_each = var.domain_no_prefix content { name = domain.value } diff --git a/modules/fastly-frontend/variables.tf b/modules/fastly-frontend/variables.tf index 4280fc6..295306a 100644 --- a/modules/fastly-frontend/variables.tf +++ b/modules/fastly-frontend/variables.tf @@ -11,9 +11,9 @@ variable "additional_domain_names" { } variable "domain_no_prefix" { - type = string - description = "Domain without env prefix used for supporting legacy domain urls" - default = "" + type = list(string) + description = "List of domains without env prefix used for supporting legacy domain urls" + default = [] } variable "bare_redirect_domain_name" { diff --git a/variables.tf b/variables.tf index a5575c9..6d47370 100644 --- a/variables.tf +++ b/variables.tf @@ -10,9 +10,9 @@ variable "additional_fastly_domains" { } variable "domain_no_prefix" { - type = string - description = "Domain without env prefix used for supporting legacy domain urls" - default = "" + type = list(string) + description = "List of domains without env prefix used for supporting legacy domain urls" + default = [] } variable "env" {