-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.tf
46 lines (36 loc) · 758 Bytes
/
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
terraform {
required_providers {
google = {
source = "hashicorp/google"
}
}
}
provider "google" {
version = "3.5.0"
credentials = file(var.credentials_file)
project = var.project
region = var.region
zone = var.zone
}
resource "google_compute_instance" "vm_instance" {
name = var.instance_name
machine_type = var.machine_type
tags = var.network_tags
boot_disk {
initialize_params {
image = var.machine_image
type = var.disk_type
size = var.disk_size
}
}
scheduling {
preemptible = true
automatic_restart = false
}
metadata_startup_script = file(var.startup_script)
network_interface {
network = "default"
access_config {
}
}
}