-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.tf
executable file
·47 lines (40 loc) · 1.14 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
module "master" {
source = "./gcp-instance"
name = "tdc-master"
image = "ubuntu-os-cloud/ubuntu-1804-lts"
machine_type = "e2-medium"
metadata_startup_script = "./scripts/install_master.sh"
ssh_keys = [
{
publickey = "ssh-rsa yourkeyabc username@PC"
user = "username"
}
]
}
module "worker" {
source = "./gcp-instance"
name = "tdc-worker"
image = "ubuntu-os-cloud/ubuntu-1804-lts"
machine_type = "e2-medium"
metadata_startup_script = "./scripts/install_worker.sh"
ssh_keys = [
{
publickey = "ssh-rsa yourkeyabc username@PC"
user = "username"
}
]
}
# Firewall
data "google_compute_network" "tdc" {
name = "default"
}
resource "google_compute_firewall" "nodeports" {
name = "nodeports"
network = data.google_compute_network.tdc.name
source_ranges = ["0.0.0.0/0"]
target_tags = ["tdc"]
allow {
protocol = "tcp"
ports = ["22","30000-40000"]
}
}