-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
45 lines (40 loc) · 917 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
variable "project_id" {
description = "backend-365003"
}
variable "project_name" {
description = "backend"
}
variable "billing_ac_id" {
description = "01967F-1DC65A-2EB891"
}
terraform {
backend "gcs" {
bucket = "texplorerbucket"
prefix = "terraform/state"
}
}
resource "google_project_service" "my_project_api" {
project = "${var.project_id}"
service = "compute.googleapis.com"
disable_dependent_services = true
}
resource "google_compute_instance" "default" {
project = "${var.project_id}"
name = "terraform"
machine_type = "f1-micro"
zone = "us-central1-a"
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
}
}
network_interface {
network = "default"
access_config {
}
}
depends_on = ["google_project_service.my_project_api"]
}
output "machinename" {
value = "${google_compute_instance.default.name}"
}