-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.tf
30 lines (25 loc) · 1017 Bytes
/
main.tf
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
# invoking vnet and subnets modules
module "vnet_with_subnets" {
# invoke vnet_and_subnets module under modules directory
source = "../modules/vnet_and_subnets"
# create resource group, vnet and subnet with the same name as cluster name
resource_group_name = var.cluster_name
vnet_name = var.cluster_name
subnet_name = var.cluster_name
# location where the resources need to be created
region = var.region
address_space = var.address_space
subnet_address_prefix = var.address_space
}
# invoking aks module to create aks cluster and node group
module "aks_with_node_group" {
# invoke aks module under modules directory
source = "../modules/aks"
cluster_name = var.cluster_name
k8s_version = var.k8s_version
region = var.region
dns_prefix = var.cluster_name
resource_group_name = module.vnet_with_subnets.az_rg_name
az_subnet_id = module.vnet_with_subnets.az_subnet_id
nodepools = var.nodepools
}