-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
49 lines (41 loc) · 1.33 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "3.72.0"
}
}
}
provider "google" {
credentials = file(var.credentials_file_path)
project = var.project_id
region = var.region
zone = var.main_zone
}
module "google_networks" {
source = "./networks"
project_id = var.project_id
region = var.region
}
module "bastion" {
source = "./bastion"
project_id = var.project_id
region = var.region
zone = var.main_zone
bastion_name = "app-cluster"
network_name = module.google_networks.network.name
subnet_name = module.google_networks.subnet.name
}
module "google_kubernetes_cluster" {
source = "./kubernetes_cluster"
project_id = var.project_id
region = var.region
node_zones = var.cluster_node_zones
service_account = var.service_account
network_name = module.google_networks.network.name
subnet_name = module.google_networks.subnet.name
master_ipv4_cidr_block = module.google_networks.cluster_master_ip_cidr_range
pods_ipv4_cidr_block = module.google_networks.cluster_pods_ip_cidr_range
services_ipv4_cidr_block = module.google_networks.cluster_services_ip_cidr_range
authorized_ipv4_cidr_block = "${module.bastion.ip}/32"
}