Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (47 sloc) 1.23 KB
terraform {
backend "gcs" {
credentials = "account.json"
prefix = "terraform/state"
}
}
provider "google" {
credentials = "${file("account.json")}"
project = "${var.project_id}"
region = "us-east1"
zone = "us-east1-b"
}
resource "google_compute_address" "regional-m1-ip" {
name = "regional-m1-ip"
}
resource "google_compute_instance" "gce-free-tier" {
name = "gce1"
machine_type = "f1-micro"
tags = ["free-tier"]
boot_disk {
auto_delete = true
initialize_params {
image = "ubuntu-os-cloud/ubuntu-1804-bionic-v20180426b"
size = 30
type = "pd-standard"
}
}
metadata {
ssh-keys = "${var.ssh_user}:${file("${var.public_key_path}")}"
}
network_interface {
access_config {
nat_ip = "${google_compute_address.regional-m1-ip.address}"
}
subnetwork = "default"
}
service_account {
scopes = [
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring.write",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/trace.append"
]
}
}