Skip to content

Instantly share code, notes, and snippets.

@AymenSegni
Created December 28, 2019 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AymenSegni/58868e1095b3720c78c2ca2ae8f8b798 to your computer and use it in GitHub Desktop.
Save AymenSegni/58868e1095b3720c78c2ca2ae8f8b798 to your computer and use it in GitHub Desktop.
# Cluster Resource Group
resource "azurerm_resource_group" "aks" {
name = var.resource_group_name
location = var.location
}
# AKS Cluster Network
module "aks_network" {
source = "../modules/aks_network"
subnet_name = var.subnet_name
vnet_name = var.vnet_name
resource_group_name = azurerm_resource_group.aks.name
subnet_cidr = var.subnet_cidr
location = var.location
address_space = var.address_space
}
# AKS IDs
module "aks_identities" {
source = "../modules/aks_identities"
cluster_name = var.cluster_name
}
# AKS Log Analytics
module "log_analytics" {
source = "../modules/log_analytics"
resource_group_name = azurerm_resource_group.aks.name
log_analytics_workspace_location = var.log_analytics_workspace_location
log_analytics_workspace_name = var.log_analytics_workspace_name
log_analytics_workspace_sku = var.log_analytics_workspace_sku
}
# AKS Cluster
module "aks_cluster" {
source = "../modules/aks-cluster"
cluster_name = var.cluster_name
location = var.location
os_type = var.os_type
dns_prefix = var.dns_prefix
resource_group_name = azurerm_resource_group.aks.name
kubernetes_version = var.kubernetes_version
node_count = var.node_count
os_disk_size_gb = "1028"
max_pods = "110"
vm_size = var.vm_size
vnet_subnet_id = module.aks_network.aks_subnet_id
client_id = module.aks_identities.cluster_client_id
client_secret = module.aks_identities.cluster_sp_secret
diagnostics_workspace_id = module.log_analytics.azurerm_log_analytics_workspace
sp_id = data.azurerm_key_vault_secret.AKSSP_AppId.value
sp_secret = data.azurerm_key_vault_secret.AKSSP_AppSecret.value
aad_tenant_id = var.AzureTenantID
aad_server_app_secret = data.azurerm_key_vault_secret.AKS_AADServer_AppSecret.value
aad_server_app_id = data.azurerm_key_vault_secret.AKS_AADServer_AppID.value
aad_client_app_id = data.azurerm_key_vault_secret.AKS_AADClient_AppId.value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment