about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/wpcarro/terraform/.gitignore4
-rw-r--r--users/wpcarro/terraform/gcp.tf47
2 files changed, 51 insertions, 0 deletions
diff --git a/users/wpcarro/terraform/.gitignore b/users/wpcarro/terraform/.gitignore
new file mode 100644
index 000000000000..f437e99d802a
--- /dev/null
+++ b/users/wpcarro/terraform/.gitignore
@@ -0,0 +1,4 @@
+*.tfstate
+*.tfstate.backup
+.terraform.lock.hcl
+.terraform/**/*
\ No newline at end of file
diff --git a/users/wpcarro/terraform/gcp.tf b/users/wpcarro/terraform/gcp.tf
new file mode 100644
index 000000000000..f287e90e919d
--- /dev/null
+++ b/users/wpcarro/terraform/gcp.tf
@@ -0,0 +1,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"]
+  }
+}
\ No newline at end of file