-
Notifications
You must be signed in to change notification settings - Fork 0
/
virtual_machine.tf
94 lines (77 loc) · 1.95 KB
/
virtual_machine.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
##################################################################
# Virtual machine
###################################################################
# If you already have Terraform installed locally, you can use this script to spin up the VM
resource "google_service_account" "default" {
account_id = "your_email_address"
display_name = "Your full name"
}
resource "google_project_iam_binding" "example_owner_binding" {
project = google_project.default.project_id
role = "roles/owner"
members = [
"serviceAccount:${google_service_account.default.email}"
]
}
resource "google_compute_instance" "instance" {
name = var.instance
machine_type = var.machine_type
zone = var.region
project = var.project
can_ip_forward = false
deletion_protection = false
confidential_instance_config {
enable_confidential_compute = false
}
boot_disk {
initialize_params {
image = "ubuntu-2004-lts"
size = 60
type = "pd-standard"
}
}
guest_accelerator {
type = "VIRTIO_SCSI_MULTIQUEUE"
count = 1
}
guest_accelerator {
type = "SEV_CAPABLE"
count = 1
}
guest_accelerator {
type = "SEV_SNP_CAPABLE"
count = 1
}
guest_accelerator {
type = "SEV_LIVE_MIGRATABLE"
count = 1
}
guest_accelerator {
type = "SEV_LIVE_MIGRATABLE_V2"
count = 1
}
guest_accelerator {
type = "IDPF"
count = 1
}
guest_accelerator {
type = "UEFI_COMPATIBLE"
count = 1
}
guest_accelerator {
type = "GVNIC"
count = 1
}
network_interface {
network = "default"
subnetwork = "default"
access_config {
network_tier = "PREMIUM"
}
}
shielded_instance_config {
enable_secure_boot = false
enable_vtpm = true
enable_integrity_monitoring = true
}
}