-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
48 lines (37 loc) · 1.11 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
provider "google" {
project = var.project_id
zone = var.zone
}
resource "google_compute_network" "tezos-test-network" {
name = "tezos-test-network"
auto_create_subnetworks = "true"
}
resource "google_compute_firewall" "tezos-test-firewall" {
name = "tezos-test-firewall"
network = google_compute_network.tezos-test-network.name
allow {
protocol = "tcp"
ports = ["22", "8732", "9732"]
}
}
resource "google_compute_instance" "tezos-test-instance" {
name = "tezos-test-instance"
machine_type = "e2-medium"
boot_disk {
initialize_params {
image = var.image_id
}
}
network_interface {
# You can use the default network here if you prefer
network = google_compute_network.tezos-test-network.self_link
# The following empty block must be here so that an external IP is created
access_config {
}
}
metadata = {
ssh-keys = "${var.tezos_ssh_user}:${file(var.tezos_ssh_user_public_key)}"
}
# Uncomment below if you skipped the Packer section and what to use a startup script
# metadata_startup_script = "${file(var.startup_script_file)}"
}