Skip to content

Commit 2aac95f

Browse files
committed
Extract var
1 parent 9710cf5 commit 2aac95f

File tree

1 file changed

+6
-4
lines changed
  • scenarios/AksOpenAiTerraform/terraform

1 file changed

+6
-4
lines changed

scenarios/AksOpenAiTerraform/terraform/main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ data "azurerm_client_config" "current" {
1515
}
1616

1717
locals {
18+
tenant_id = data.azurerm_client_config.current.tenant_id
19+
1820
vm_subnet_name = "VmSubnet"
1921
system_node_pool_subnet_name = "SystemSubnet"
2022
user_node_pool_subnet_name = "UserSubnet"
@@ -80,7 +82,7 @@ module "aks_cluster" {
8082
location = var.location
8183
resource_group_name = azurerm_resource_group.rg.name
8284
resource_group_id = azurerm_resource_group.rg.id
83-
tenant_id = data.azurerm_client_config.current.tenant_id
85+
tenant_id = local.tenant_id
8486

8587
kubernetes_version = var.kubernetes_version
8688
sku_tier = "Free"
@@ -128,7 +130,7 @@ module "key_vault" {
128130
location = var.location
129131
resource_group_name = azurerm_resource_group.rg.name
130132

131-
tenant_id = data.azurerm_client_config.current.tenant_id
133+
tenant_id = local.tenant_id
132134
sku_name = "standard"
133135
enabled_for_deployment = true
134136
enabled_for_disk_encryption = true
@@ -148,15 +150,15 @@ module "deployment_script" {
148150
location = var.location
149151
resource_group_name = azurerm_resource_group.rg.name
150152

151-
azure_cli_version = "2.9.1"
153+
azure_cli_version = "2.68.0"
152154
managed_identity_name = "${var.name_prefix}ScriptManagedIdentity"
153155
aks_cluster_name = module.aks_cluster.name
154156
hostname = "magic8ball.contoso.com"
155157
namespace = local.namespace
156158
service_account_name = local.service_account_name
157159
email = var.email
158160
primary_script_uri = "https://paolosalvatori.blob.core.windows.net/scripts/install-nginx-via-helm-and-create-sa.sh"
159-
tenant_id = data.azurerm_client_config.current.tenant_id
161+
tenant_id = local.tenant_id
160162
subscription_id = data.azurerm_client_config.current.subscription_id
161163
workload_managed_identity_client_id = azurerm_user_assigned_identity.aks_workload_identity.client_id
162164

0 commit comments

Comments
 (0)