Skip to content

Commit 09f7f93

Browse files
committed
creates app i can run
1 parent 1c548de commit 09f7f93

4 files changed

Lines changed: 20 additions & 27 deletions

File tree

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
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
112
locals {
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
2217
resource "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+
}

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
output "resource_group_name" {
2-
value = azurerm_resource_group.default.name
3-
}
4-
51
output "client_key" {
62
value = azurerm_kubernetes_cluster.k8s.kube_config.0.client_key
73
}
@@ -37,4 +33,4 @@ output "identity_resource_id" {
3733

3834
output "identity_client_id" {
3935
value = azurerm_user_assigned_identity.testIdentity.client_id
40-
}
36+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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>"

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
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

119
variable "aks_service_principal_app_id" {
@@ -27,7 +25,7 @@ variable "virtual_network_name" {
2725

2826
variable "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

3331
variable "aks_subnet_name" {
@@ -37,12 +35,12 @@ variable "aks_subnet_name" {
3735

3836
variable "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

4341
variable "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

4846
variable "app_gateway_name" {

0 commit comments

Comments
 (0)