-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
61 lines (52 loc) · 2 KB
/
Copy pathmain.tf
File metadata and controls
61 lines (52 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
resource "random_string" "seed" {
length = 4
special = false
upper = false
}
resource "azurerm_resource_group" "rg" {
location = var.location
name = var.resource_group_name
}
module "container_registry" {
source = "./modules/container_registry"
seed = random_string.seed.result
resource_group = azurerm_resource_group.rg
node_principal_id = module.aks.node_principal_id
}
module "container_storage" {
source = "./modules/container_storage"
seed = random_string.seed.result
resource_group = azurerm_resource_group.rg
app_domain = var.app_domain
kubernetes_object_id = module.aks.node_principal_id
}
module "network" {
source = "./modules/network"
resource_group = azurerm_resource_group.rg
}
module "aks" {
source = "./modules/aks"
resource_group = azurerm_resource_group.rg
seed = random_string.seed.result
default_node_pool = {
vnet_subnet_id = module.network.subnet.id
temporary_name_for_rotation = var.k8s_default_node_pool.temporary_name_for_rotation
name = var.k8s_default_node_pool.name
min_count = var.k8s_default_node_pool.min_count
max_count = var.k8s_default_node_pool.max_count
max_pods = var.k8s_default_node_pool.max_pods
upgrade_settings_max_surge = var.k8s_default_node_pool.upgrade_settings_max_surge
vm_size = var.k8s_default_node_pool.vm_size
}
}
module "postgres" {
source = "./modules/postgres"
tenant_id = data.azurerm_client_config.current.tenant_id
k8s_pods_cidr = module.aks.pod_cidr
resource_group = azurerm_resource_group.rg
seed = random_string.seed.result
virtual_network = module.network.virtual_network
flexible_server_sku_name = var.db_sku_name
postgres_version = var.postgres_version
}
data "azurerm_client_config" "current" {}