diff --git a/main.tf b/main.tf index 718c55e..481656e 100644 --- a/main.tf +++ b/main.tf @@ -77,3 +77,9 @@ module "dns" { records = lookup(each.value, "records") } +resource "hcloud_ssh_key" "this" { + for_each = var.ssh_keys + name = each.key + public_key = each.value +} + diff --git a/variables.tf b/variables.tf index a6f2900..a2f3c10 100644 --- a/variables.tf +++ b/variables.tf @@ -1,4 +1,8 @@ -variable "hetzner_apitoken" { +variable "hetzner_dns_apitoken" { + type = string +} + +variable "hetzner_cloud_apitoken" { type = string } @@ -11,3 +15,7 @@ variable "sozpaedil_net_dkim" { type = string sensitive = true } + +variable "ssh_keys" { + type = map(string) +} diff --git a/versions.tf b/versions.tf index 0f13710..1b913b9 100644 --- a/versions.tf +++ b/versions.tf @@ -4,9 +4,17 @@ terraform { source = "timohirt/hetznerdns" version = "2.2.0" } + hcloud = { + source = "hetznercloud/hcloud" + version = "1.50.0" + } } } provider "hetznerdns" { apitoken = var.hetzner_dns_apitoken } + +provider "hcloud" { + token = var.hetzner_cloud_apitoken +}