From 09f7f93885680e21306339ec5c1e0db1714699c8 Mon Sep 17 00:00:00 2001 From: Tom Archer Date: Fri, 4 Mar 2022 20:32:36 -0800 Subject: [PATCH] creates app i can run --- .../main.tf | 15 +++++---------- .../output.tf | 6 +----- .../terraform.tfvars | 10 +++++++--- .../variables.tf | 16 +++++++--------- 4 files changed, 20 insertions(+), 27 deletions(-) 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 d501d1a6..21092e64 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/main.tf @@ -1,12 +1,3 @@ -resource "random_pet" "rg-name" { - prefix = var.resource_group_name_prefix -} - -data "azurerm_resource_group" "rg" { - name = random_pet.rg-name.id - location = var.resource_group_location -} - # Locals block for hardcoded names locals { backend_address_pool_name = "${azurerm_virtual_network.test.name}-beap" @@ -18,6 +9,10 @@ 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 @@ -207,4 +202,4 @@ resource "azurerm_kubernetes_cluster" "k8s" { depends_on = [azurerm_virtual_network.test, azurerm_application_gateway.network] tags = var.tags -} +} \ No newline at end of file diff --git a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf index 96455e12..509d916b 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/output.tf @@ -1,7 +1,3 @@ -output "resource_group_name" { - value = azurerm_resource_group.default.name -} - output "client_key" { value = azurerm_kubernetes_cluster.k8s.kube_config.0.client_key } @@ -37,4 +33,4 @@ output "identity_resource_id" { output "identity_client_id" { value = azurerm_user_assigned_identity.testIdentity.client_id -} +} \ No newline at end of file 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 93a1739d..1ecbb870 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,9 @@ -aks_service_principal_app_id = "" +resource_group_name = "" + +location = "" + +aks_service_principal_app_id = "" -aks_service_principal_client_secret = "" +aks_service_principal_client_secret = "" -aks_service_principal_object_id = "" +aks_service_principal_object_id = "" 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 71aee633..044807c6 100644 --- a/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf +++ b/quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress/variables.tf @@ -1,11 +1,9 @@ -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_name" { + description = "Name of the resource group." } -variable "resource_group_location" { - default = "eastus" - description = "Location of the resource group." +variable "location" { + description = "Location of the cluster." } variable "aks_service_principal_app_id" { @@ -27,7 +25,7 @@ variable "virtual_network_name" { variable "virtual_network_address_prefix" { description = "VNET address prefix" - default = "192.168.0.0/16" + default = "15.0.0.0/8" } variable "aks_subnet_name" { @@ -37,12 +35,12 @@ variable "aks_subnet_name" { variable "aks_subnet_address_prefix" { description = "Subnet address prefix." - default = "192.168.0.0/16" + default = "15.0.0.0/16" } variable "app_gateway_subnet_address_prefix" { description = "Subnet server IP address." - default = "192.168.0.0/16" + default = "15.1.0.0/16" } variable "app_gateway_name" {