File tree Expand file tree Collapse file tree
quickstart/201-k8s-cluster-with-aks-applicationgateway-ingress Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- resource "random_pet" "rg-name" {
2- prefix = var. resource_group_name_prefix
3- }
4-
5- data "azurerm_resource_group" "rg" {
6- name = random_pet. rg-name . id
7- location = var. resource_group_location
8- }
9-
101# Locals block for hardcoded names
112locals {
123 backend_address_pool_name = " ${ azurerm_virtual_network . test . name } -beap"
@@ -18,6 +9,10 @@ locals {
189 app_gateway_subnet_name = " appgwsubnet"
1910}
2011
12+ data "azurerm_resource_group" "rg" {
13+ name = var. resource_group_name
14+ }
15+
2116# User Assigned Identities
2217resource "azurerm_user_assigned_identity" "testIdentity" {
2318 resource_group_name = data. azurerm_resource_group . rg . name
@@ -207,4 +202,4 @@ resource "azurerm_kubernetes_cluster" "k8s" {
207202
208203 depends_on = [azurerm_virtual_network . test , azurerm_application_gateway . network ]
209204 tags = var. tags
210- }
205+ }
Original file line number Diff line number Diff line change 1- output "resource_group_name" {
2- value = azurerm_resource_group. default . name
3- }
4-
51output "client_key" {
62 value = azurerm_kubernetes_cluster. k8s . kube_config . 0 . client_key
73}
@@ -37,4 +33,4 @@ output "identity_resource_id" {
3733
3834output "identity_client_id" {
3935 value = azurerm_user_assigned_identity. testIdentity . client_id
40- }
36+ }
Original file line number Diff line number Diff line change 1- aks_service_principal_app_id = " <Service principal appId>"
1+ resource_group_name = " <resource_group_location>"
2+
3+ location = " <resource_group_location>"
4+
5+ aks_service_principal_app_id = " <service_principal_appId>"
26
3- aks_service_principal_client_secret = " <Service principal password >"
7+ aks_service_principal_client_secret = " <service_principal_password >"
48
5- aks_service_principal_object_id = " <Service principal object ID >"
9+ aks_service_principal_object_id = " <service_principal_object_id >"
Original file line number Diff line number Diff line change 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."
1+ variable "resource_group_name" {
2+ description = " Name of the resource group."
43}
54
6- variable "resource_group_location" {
7- default = " eastus"
8- description = " Location of the resource group."
5+ variable "location" {
6+ description = " Location of the cluster."
97}
108
119variable "aks_service_principal_app_id" {
@@ -27,7 +25,7 @@ variable "virtual_network_name" {
2725
2826variable "virtual_network_address_prefix" {
2927 description = " VNET address prefix"
30- default = " 192.168 .0.0/16 "
28+ default = " 15.0 .0.0/8 "
3129}
3230
3331variable "aks_subnet_name" {
@@ -37,12 +35,12 @@ variable "aks_subnet_name" {
3735
3836variable "aks_subnet_address_prefix" {
3937 description = " Subnet address prefix."
40- default = " 192.168 .0.0/16"
38+ default = " 15.0 .0.0/16"
4139}
4240
4341variable "app_gateway_subnet_address_prefix" {
4442 description = " Subnet server IP address."
45- default = " 192.168 .0.0/16"
43+ default = " 15.1 .0.0/16"
4644}
4745
4846variable "app_gateway_name" {
You can’t perform that action at this time.
0 commit comments