-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc.tf
62 lines (55 loc) · 1.4 KB
/
vpc.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
50
51
52
53
54
55
56
57
58
59
60
61
62
resource "random_integer" "suffix" {
min = 100000
max = 500000
}
locals {
project_id = "gitops-gke-tf-343434"
cluster = "gitops-gke-tf"
cluster_name = "gitops-gke-tf-${random_integer.suffix.result}"
}
provider "google" {
project = local.project_id
region = "europe-west1"
}
module "vpc" {
source = "terraform-google-modules/network/google"
version = "3.2.2"
project_id = local.project_id
network_name = "${local.cluster_name}-vpc"
subnets = [
{
subnet_name = "europe-west1-01"
subnet_ip = "10.10.0.0/16"
subnet_region = "europe-west1"
subnet_private_access = "true"
},
{
subnet_name = "europe-west1-02"
subnet_ip = "10.20.0.0/16"
subnet_region = "europe-west1"
subnet_private_access = "true"
}
]
secondary_ranges = {
europe-west1-01 = [
{
range_name = "europe-west1-01-gke-01-pods"
ip_cidr_range = "192.167.0.0/16"
},
{
range_name = "europe-west1-01-gke-01-services"
ip_cidr_range = "192.168.0.0/16"
}
]
europe-west1-02 = []
}
routes = [
{
name = "egress-internet"
description = "route through IGW to access internet"
destination_range = "0.0.0.0/0"
tags = "egress-inet"
next_hop_internet = "true"
}
]
}