-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
49 lines (37 loc) · 848 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
46
47
48
49
# manage state into cloud storage with versioning activated
terraform {
backend "gcs" {
bucket = "qb-worldcup"
prefix = "/terraform.tfstate"
}
}
# terraform google provider
provider "google" {
version = "2.5.0"
region = "${var.region}"
}
# get available zones
data "google_compute_zones" "available" {
project = "${var.project}"
}
# compute instance with custom image
resource "google_compute_instance" "default" {
name = "tf-worldcup-${count.index}"
project = "${var.project}"
zone = "${data.google_compute_zones.available.names[0]}"
machine_type = "n1-standard-1"
tags = []
boot_disk {
initialize_params {
image = "fra-bel"
}
}
network_interface {
network = "default"
access_config {
}
}
}
output "instance_id" {
value = "${google_compute_instance.default.self_link}"
}