-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvm.tf
47 lines (36 loc) · 1.07 KB
/
vm.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
resource "google_compute_instance" "vm" {
project = "${google_project.proj.project_id}"
name = "duanics"
machine_type = "f1-micro"
zone = "${var.region_zone}"
allow_stopping_for_update = true
lifecycle {
ignore_changes = ["boot_disk.0.initialize_params.0.image"]
}
boot_disk {
initialize_params {
image = "ubuntu-os-cloud/ubuntu-1604-lts"
}
}
tags = ["multihomed"]
metadata_startup_script = "${file("scripts/setup.sh")}"
network_interface {
subnetwork = "${google_compute_subnetwork.subnetwork1.self_link}"
access_config {
// Ephemeral IP
}
}
network_interface {
network = "default"
access_config {
// Ephemeral IP
}
}
depends_on = ["google_project_services.services1", "google_compute_network.heretic"]
}
output "ip1" {
value = "${google_compute_instance.vm.network_interface.0.access_config.0.assigned_nat_ip}"
}
output "ip2" {
value = "${google_compute_instance.vm.network_interface.1.access_config.0.assigned_nat_ip}"
}