tvl-depot/users/wpcarro/terraform/gcp.tf
Vincent Ambo 350c5eae46 style(wpcarro/terraform): Apply terraform fmt to files
This is going to be enforced in CI very shortly (it already kind of
was, but not really).

Change-Id: I8569d030e31230f077371bd1644b75f048271a0e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4728
Tested-by: BuildkiteCI
Autosubmit: tazjin <mail@tazj.in>
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: wpcarro <wpcarro@gmail.com>
2021-12-28 12:57:53 +00:00

65 lines
No EOL
1.1 KiB
HCL

provider "google" {
project = "wpcarros-infrastructure"
region = "us-central1"
zone = "us-central1-a"
}
data "google_compute_default_service_account" "default" {}
resource "google_compute_instance" "default" {
name = "diogenes-2"
machine_type = "e2-standard-2"
zone = "us-central1-a"
hostname = "diogenes.wpcarro.dev"
tags = [
"http-server",
"https-server",
"diogenes-firewall"
]
boot_disk {
device_name = "boot"
initialize_params {
size = 10
image = "nixos-20-03"
}
}
network_interface {
network = "default"
subnetwork = "default"
access_config {
public_ptr_domain_name = "wpcarro.dev"
}
}
metadata = {
enable-oslogin = "TRUE"
}
service_account {
scopes = ["cloud-platform"]
}
}
resource "google_compute_firewall" "default" {
name = "diogenes-firewall"
network = "default"
allow {
protocol = "tcp"
ports = ["6698"]
}
allow {
protocol = "udp"
ports = [
"60000-61000" # mosh
]
}
source_tags = ["diogenes-firewall"]
}