aboutsummaryrefslogtreecommitdiffstats
path: root/main.tf
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-09-23 16:13:58 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-09-23 16:13:58 -0700
commit32bff4694851c7262d98c66fc40324ea4324ce21 (patch)
treedaca0d711212cdf67e59637ccefbe00da798d6ca /main.tf
downloadsite-infra-32bff4694851c7262d98c66fc40324ea4324ce21.zip
Initial Commit
Diffstat (limited to 'main.tf')
-rw-r--r--main.tf40
1 files changed, 40 insertions, 0 deletions
diff --git a/main.tf b/main.tf
new file mode 100644
index 0000000..4254f2f
--- /dev/null
+++ b/main.tf
@@ -0,0 +1,40 @@
+terraform {
+ required_providers {
+ hcloud = {
+ source = "hetznercloud/hcloud"
+ version = "~> 1.68.0"
+ }
+ }
+}
+
+provider "hcloud" {
+ token = var.hcloud_token
+}
+
+variable "hcloud_token" {
+ type = string
+ sensitive = true
+}
+
+data "hcloud_image" "openbsd" {
+ with_selector = "os=openbsd,version=7.9,arch=amd64"
+ most_recent = true
+}
+
+resource "hcloud_ssh_key" "default" {
+ name = "default-key"
+ public_key = file("~/.ssh/id_rsa.pub")
+}
+
+resource "hcloud_server" "vm" {
+ name = "web01"
+ image = data.hcloud_image.openbsd.id
+ server_type = "cx23"
+ location = "nbg1"
+ ssh_keys = [hcloud_ssh_key.default.id]
+
+ public_net {
+ ipv4_enabled = true
+ ipv6_enabled = true
+ }
+}