GG
Size: a a a
GG
SS
YF
SS
YF
SS
YF
SS
SS
YF
YF
YF
YF
SS
YF
В
locals {
ssh_key_names = "${keys(var.ssh_keys)}"
}
resource "hcloud_ssh_key" "keys" {
count = "${length(local.ssh_key_names)}"
name = "${element(local.ssh_key_names, count.index)}"
public_key = "${var.ssh_keys[element(local.ssh_key_names, count.index)]}"
}
resource "hcloud_server" "kube-main" {
name = "kube01"
image = "centos-7"
location = "nbg1"
server_type = "cx31"
ssh_keys = ["${hcloud_ssh_key.keys.*.id}"]
}В
lifecycle {
ignore_changes = [ "ssh_keys" ]
}EK
AK
EK