From 0c8350ba484f794cb139248d39c7a6199de6fae6 Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Wed, 30 Aug 2023 16:14:21 +0000 Subject: [PATCH] chore: have resource group created per workspace --- experiment/main.tf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/experiment/main.tf b/experiment/main.tf index 08148352..0a6a8495 100644 --- a/experiment/main.tf +++ b/experiment/main.tf @@ -23,7 +23,13 @@ provider "azurerm" { features {} } +locals { + is_prod = terraform.workspace == "default" + is_test = terraform.workspace == "test" + env_name = local.is_prod ? "prod" : terraform.workspace +} + resource "azurerm_resource_group" "rg" { - name = "myTFResourceGroup" + name = "myTFResourceGroup-${local.env_name}" location = "westus2" }