-
Notifications
You must be signed in to change notification settings - Fork 1
/
samplenet.tf
35 lines (31 loc) · 1.06 KB
/
samplenet.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
# Create the samplenetwork network
resource "google_compute_network" "samplenetwork" {
name = "samplenetwork"
auto_create_subnetworks = true
}
# Create a firewall rule to allow HTTP, SSH, RDP and ICMP traffic on samplenetwork
resource "google_compute_firewall" "samplenetwork_allow_http_ssh_rdp_icmp" {
name = "samplenetwork-allow-http-ssh-rdp-icmp"
network = "${google_compute_network.samplenetwork.self_link}"
allow {
protocol = "tcp"
ports = ["22", "80", "3389"]
}
allow {
protocol = "icmp"
}
}
# Create the samplenet-us-vm instance
module "samplenet-us-vm" {
source = "./instance"
instance_name = "samplenet-us-vm"
instance_zone = "us-central1-a"
instance_subnetwork = "${google_compute_network.samplenetwork.self_link}"
}
# Create the samplenet-eu-vm" instance
module "samplenet-eu-vm" {
source = "./instance"
instance_name = "samplenet-eu-vm"
instance_zone = "europe-west1-d"
instance_subnetwork = "${google_compute_network.samplenetwork.self_link}"
}