diff options
Diffstat (limited to 'web/main.tf')
| -rw-r--r-- | web/main.tf | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/web/main.tf b/web/main.tf new file mode 100644 index 0000000..bf49fd0 --- /dev/null +++ b/web/main.tf @@ -0,0 +1,39 @@ +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 +} + +data "hcloud_ssh_key" "default" { + name = data.terraform_remote_state.account.outputs.ssh_key_name +} + +resource "hcloud_server" "web01" { + name = "web01" + image = data.hcloud_image.openbsd.id + server_type = "cx23" + location = "nbg1" + ssh_keys = [data.hcloud_ssh_key.default.id] + + public_net { + ipv4_enabled = true + ipv6_enabled = true + } +} |