Skip to content

Commit

Permalink
chore: have resource group created per workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Aug 30, 2023
1 parent 81879d9 commit 0c8350b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion experiment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 0c8350b

Please sign in to comment.