diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf index 857241e2..d501d1a6 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf @@ -1,10 +1,10 @@ resource "random_pet" "rg-name" { - prefix = var.name_prefix + prefix = var.resource_group_name_prefix } -resource "azurerm_resource_group" "default" { - name = random_pet.rg-name.id - location = var.location +data "azurerm_resource_group" "rg" { + name = random_pet.rg-name.id + location = var.resource_group_location } # Locals block for hardcoded names @@ -18,10 +18,6 @@ locals { app_gateway_subnet_name = "appgwsubnet" } -data "azurerm_resource_group" "rg" { - name = var.resource_group_name -} - # User Assigned Identities resource "azurerm_user_assigned_identity" "testIdentity" { resource_group_name = data.azurerm_resource_group.rg.name diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars index f615cc5e..93a1739d 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars @@ -1,5 +1,3 @@ -location = "" - aks_service_principal_app_id = "" aks_service_principal_client_secret = "" diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf index 6b207ee8..71aee633 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf @@ -1,6 +1,11 @@ -variable "location" { - default = "eastus" - description = "Location of the resource." +variable "resource_group_name_prefix" { + default = "rg" + description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." +} + +variable "resource_group_location" { + default = "eastus" + description = "Location of the resource group." } variable "aks_service_principal_app_id" {