File tree 3 files changed +12
-49
lines changed
3 files changed +12
-49
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,14 @@ terraform {
12
12
provider "hcloud" {
13
13
token = var. hcloud_token
14
14
}
15
+
16
+ # Manage ssh authorized keys so Hetzner can use them to provision our resources (e.g.: new VPS)
17
+ resource "hcloud_ssh_key" "ssh_keys" {
18
+ for_each = {
19
+ tf-benoit-000619776016 = " ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIZtWY7t8HVnaz6bluYsrAlzZC3MZtb8g0nO5L5fCQKR benoit@leastauthority.com"
20
+ tf-florian-000018054987 = " ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJlPneIaRT/mqu13N83ctEftub4O6zAfi6qgzZKerU5o florian@leastauthority.com"
21
+ }
22
+
23
+ name = each. key
24
+ public_key = each. value
25
+ }
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ resource "hcloud_server" "webforge" {
13
13
" env" : " prod"
14
14
" source" : " tf-tahoe-lafs-core"
15
15
}
16
- ssh_keys = [for k , v in local . ssh_keys : " tf- ${ v . name } " ]
16
+ ssh_keys = [for k in hcloud_ssh_key . ssh_keys : k . name ]
17
17
user_data = << EOF
18
18
#cloud-config
19
19
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments