From 1f6fe7164715e3bb19de05fb69396f7175da9006 Mon Sep 17 00:00:00 2001 From: Julien S Date: Mon, 8 Jan 2024 15:26:28 +0100 Subject: [PATCH 1/5] Update variables.tf --- terraform/variables.tf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 3b42e8c..851bdc0 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -72,4 +72,10 @@ variable "user_id" { description = "The user id to assign the Contributor role to the resource group" type = string default = "" -} \ No newline at end of file +} + +variable "lab_suffix" { + description = "A nullable suffix for a specific lab to be edited. Helps with keeping track of labs' cohorts in the same subscription" + type = string + default = "" +} From 85ec72dd7b7478f730d17cb8183b03976fc41692 Mon Sep 17 00:00:00 2001 From: Julien S Date: Mon, 8 Jan 2024 15:28:27 +0100 Subject: [PATCH 2/5] Update locals.tf --- terraform/locals.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terraform/locals.tf b/terraform/locals.tf index 7f3cf9d..767099c 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -1,5 +1,6 @@ locals { - resource_suffix = [lower(var.environment), substr(lower(var.location), 0, 2), substr(lower(var.application), 0, 3), lower(var.owner), random_id.resource_group_name_suffix.hex, var.resource_group_name_suffix] + generated_suffix = coalesce(var.cohort_suffix, random_id.resource_group_name_suffix.hex) + resource_suffix = [lower(var.environment), substr(lower(var.location), 0, 2), substr(lower(var.application), 0, 3), lower(var.owner), local.generated_suffix, var.resource_group_name_suffix] resource_suffix_kebabcase = join("-", local.resource_suffix) resource_suffix_lowercase = join("", local.resource_suffix) @@ -15,6 +16,7 @@ locals { "Scm" = var.scm, "Application" = var.application "Resource Suffix" = var.resource_group_name_suffix + "Cohort Suffix" = local.generated_suffix } ) ) From 7dd1b354fdfbe5d886b86d7bc9479d730f0849cf Mon Sep 17 00:00:00 2001 From: Julien S Date: Mon, 8 Jan 2024 15:28:51 +0100 Subject: [PATCH 3/5] Update variables.tf --- terraform/variables.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 851bdc0..7f6a0ef 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -74,8 +74,8 @@ variable "user_id" { default = "" } -variable "lab_suffix" { - description = "A nullable suffix for a specific lab to be edited. Helps with keeping track of labs' cohorts in the same subscription" +variable "cohort_suffix" { + description = "A cohort suffix for a specific lab to be edited. Helps with keeping track of labs' cohorts in the same subscription" type = string default = "" } From d92ac96e18930235f71112e28cd35517249940a5 Mon Sep 17 00:00:00 2001 From: Julien S Date: Mon, 8 Jan 2024 15:29:21 +0100 Subject: [PATCH 4/5] Update variables.tf --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 7f6a0ef..4de2670 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -75,7 +75,7 @@ variable "user_id" { } variable "cohort_suffix" { - description = "A cohort suffix for a specific lab to be edited. Helps with keeping track of labs' cohorts in the same subscription" + description = "[Optional] A cohort suffix for a specific lab to be edited. Helps with keeping track of labs' cohorts in the same subscription" type = string default = "" } From fe6a710274bb04dd02b7f2bbed316e8db5470975 Mon Sep 17 00:00:00 2001 From: Julien S Date: Mon, 8 Jan 2024 15:46:57 +0100 Subject: [PATCH 5/5] Update providers.tf --- terraform/providers.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/providers.tf b/terraform/providers.tf index 36f8f14..9dc629e 100644 --- a/terraform/providers.tf +++ b/terraform/providers.tf @@ -16,8 +16,8 @@ terraform { } } - backend "local" {} - # backend "azurerm" {} + # backend "local" {} + backend "azurerm" {} } provider "azurerm" {