-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathsubnets.tf
40 lines (38 loc) · 1.07 KB
/
subnets.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
31
32
33
34
35
36
37
38
39
40
# subnets.tf
locals {
# Subnets definition
subnets = {
"main-cni-vpc" = { # VPC Name here for the subset of rules below
subnets = [{
subnet_name = "main-cni-subnet"
subnet_ip = "10.10.10.0/24"
subnet_region = var.region
subnet_flow_logs = "true"
description = "Main CNI Subnet"
subnet_private_access = true
}
]
}
# "multus-vpc" = {
# subnets = [{
# subnet_name = "multus-subnet"
# subnet_ip = "10.20.20.0/24"
# subnet_region = var.region
# subnet_flow_logs = "true"
# description = "Multus Subnet"
# subnet_private_access = true
# }
# ]
# }
}
}
# Subnet Creation
module "subnets" {
for_each = local.subnets
source = "terraform-google-modules/network/google//modules/subnets"
version = "5.2.0"
project_id = var.project_id
network_name = each.key
subnets = each.value.subnets
depends_on = [module.vpcs]
}