-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgcp-networking.tf
82 lines (62 loc) · 1.72 KB
/
gcp-networking.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Main Project
module "vpc_network" {
source = "./modules/gcp-vpc-network"
name = "foundations"
depends_on = [
google_project_service.iap
]
}
module "vpc_subnetwork_gcp_us_west1" {
source = "./modules/gcp-vpc-subnetwork"
name = "foundations-us-west1"
gcp_network_id = module.vpc_network.gcp_network_id
gcp_region = "us-west1"
ipv4_cidr = "10.64.0.0/24"
depends_on = [
module.vpc_network
]
}
# Planktoscope Project
module "vpc_network_planktoscope" {
source = "./modules/gcp-vpc-network"
name = "foundations"
depends_on = [
google_project_service.iap_planktoscope
]
providers = {
google = google.planktoscope
}
}
module "vpc_subnetwork_planktoscope_gcp_us_west1" {
source = "./modules/gcp-vpc-subnetwork"
name = "foundations-us-west1"
gcp_network_id = module.vpc_network_planktoscope.gcp_network_id
gcp_region = "us-west1"
ipv4_cidr = "10.64.64.0/24"
depends_on = [
module.vpc_network_planktoscope
]
providers = {
google = google.planktoscope
}
}
# Network Peering
resource "google_compute_network_peering" "main_planktoscope" {
name = "main-planktoscope"
network = module.vpc_network.gcp_network_self_link
peer_network = module.vpc_network_planktoscope.gcp_network_self_link
depends_on = [
module.vpc_network,
module.vpc_network_planktoscope
]
}
resource "google_compute_network_peering" "planktoscope_main" {
provider = google.planktoscope
name = "planktoscope-main"
network = module.vpc_network_planktoscope.gcp_network_self_link
peer_network = module.vpc_network.gcp_network_self_link
depends_on = [
module.vpc_network_planktoscope,
module.vpc_network
]
}