Working on randomizing RG

This commit is contained in:
Tom Archer 2022-03-04 15:03:42 -08:00
parent e7300d5f62
commit 1c548de790
3 changed files with 12 additions and 13 deletions

View File

@ -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

View File

@ -1,5 +1,3 @@
location = "<Resource group location>"
aks_service_principal_app_id = "<Service principal appId>"
aks_service_principal_client_secret = "<Service principal password>"

View File

@ -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" {