Skip to content

Commit 1c548de

Browse files
committed
Working on randomizing RG
1 parent e7300d5 commit 1c548de

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
resource "random_pet" "rg-name" {
2-
prefix = var.name_prefix
2+
prefix = var.resource_group_name_prefix
33
}
44

5-
resource "azurerm_resource_group" "default" {
6-
name = random_pet.rg-name.id
7-
location = var.location
5+
data "azurerm_resource_group" "rg" {
6+
name = random_pet.rg-name.id
7+
location = var.resource_group_location
88
}
99

1010
# Locals block for hardcoded names
@@ -18,10 +18,6 @@ locals {
1818
app_gateway_subnet_name = "appgwsubnet"
1919
}
2020

21-
data "azurerm_resource_group" "rg" {
22-
name = var.resource_group_name
23-
}
24-
2521
# User Assigned Identities
2622
resource "azurerm_user_assigned_identity" "testIdentity" {
2723
resource_group_name = data.azurerm_resource_group.rg.name

quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/terraform.tfvars

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
location = "<Resource group location>"
2-
31
aks_service_principal_app_id = "<Service principal appId>"
42

53
aks_service_principal_client_secret = "<Service principal password>"

quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
variable "location" {
2-
default = "eastus"
3-
description = "Location of the resource."
1+
variable "resource_group_name_prefix" {
2+
default = "rg"
3+
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
4+
}
5+
6+
variable "resource_group_location" {
7+
default = "eastus"
8+
description = "Location of the resource group."
49
}
510

611
variable "aks_service_principal_app_id" {

0 commit comments

Comments
 (0)