-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_resources_backup
More file actions
39 lines (38 loc) · 861 Bytes
/
02_resources_backup
File metadata and controls
39 lines (38 loc) · 861 Bytes
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
resource "google_compute_instance" "default" {
name = "${var.name}"
machine_type = "${var.machine_type}"
zone = "${var.zone}"
tags = "${var.tags}"
boot_disk {
initialize_params {
image = "${var.image}"
}
}
network_interface {
network = "${var.network}"
access_config {
// Ephemeral IP
}
}
metadata {
sshKeys = "${var.ssh_user}:${file("${var.public_key}")}"
}
provisioner "remote-exec" {
connection = {
type = "ssh"
user = "${var.ssh_user}"
private_key = "${file("${var.private_key}")}"
}
inline = [
"${lookup(var.install_packages, var.package_manager)} ${join(" ", var.packages)}"
]
}
provisioner "remote-exec" {
connection = {
type = "ssh"
user = "${var.ssh_user}"
private_key = "${file("${var.private_key}")}"
}
scripts = "${var.scripts}"
}
}