creates app i can run

This commit is contained in:
Tom Archer 2022-03-04 20:32:36 -08:00
parent 1c548de790
commit 09f7f93885
4 changed files with 20 additions and 27 deletions

View File

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

View File

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

View File

@ -1,5 +1,9 @@
aks_service_principal_app_id = "<Service principal appId>"
resource_group_name = "<resource_group_location>"
location = "<resource_group_location>"
aks_service_principal_app_id = "<service_principal_appId>"
aks_service_principal_client_secret = "<Service principal password>"
aks_service_principal_client_secret = "<service_principal_password>"
aks_service_principal_object_id = "<Service principal object ID>"
aks_service_principal_object_id = "<service_principal_object_id>"

View File

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