diff --git a/main.tf b/main.tf index c85a4f0..81c5171 100644 --- a/main.tf +++ b/main.tf @@ -68,7 +68,7 @@ resource "hcloud_volume" "volume" { } resource "hcloud_ssh_key" "key" { - for_each = { for row in toset(var.ssh_keys) : element(split(" ", row), 2) => row } + for_each = { for row in toset(var.hcloud_ssh_keys) : element(split(" ", row), 2) => row } name = each.key public_key = "${element(split(" ", each.value), 0)} ${element(split(" ", each.value), 1)}" diff --git a/variables.tf b/variables.tf index 3a91b17..2151588 100644 --- a/variables.tf +++ b/variables.tf @@ -7,6 +7,10 @@ variable "hcloud_project" { type = string } +variable "hcloud_ssh_keys" { + type = list(string) +} + // Cloudflare variable "cloudflare_api_token" { type = string @@ -42,10 +46,6 @@ variable "server_keys" { type = list(string) } -variable "ssh_keys" { - type = list(string) -} - variable "server_dns_zone" { type = string }