about summary refs log tree commit diff
path: root/users/wpcarro/terraform/gcp.tf
blob: f287e90e919d5256b8815c6f2111d4953e8b3c2f (plain) (blame)
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
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",
    "mosh-server",
    "quassel-core",
  ]

  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"]
  }
}