@@ -51,7 +51,7 @@ variable "instance_os" {
51
51
description = " Which operating system should your workspace use?"
52
52
default = " ubuntu-20.04"
53
53
validation {
54
- condition = contains ([" ubuntu-22.04" ," ubuntu-20.04" ," ubuntu-18.04" ," debian-11" ," debian-10" ], var. instance_os )
54
+ condition = contains ([" ubuntu-22.04" ," ubuntu-20.04" ," ubuntu-18.04" ," debian-11" ," debian-10" , " fedora-36 " ], var. instance_os )
55
55
error_message = " Invalid OS!"
56
56
}
57
57
}
@@ -91,12 +91,24 @@ resource "coder_app" "code-server" {
91
91
relative_path = true
92
92
}
93
93
94
+ # Generate a dummy ssh key that is not accessible so Hetzner cloud does not spam the admin with emails.
95
+ resource "tls_private_key" "rsa_4096" {
96
+ algorithm = " RSA"
97
+ rsa_bits = 4096
98
+ }
99
+
100
+ resource "hcloud_ssh_key" "root" {
101
+ name = " coder-${ data . coder_workspace . me . owner } -${ data . coder_workspace . me . name } -root"
102
+ public_key = tls_private_key. rsa_4096 . public_key_openssh
103
+ }
104
+
94
105
resource "hcloud_server" "root" {
95
106
count = data. coder_workspace . me . start_count
96
107
name = " coder-${ data . coder_workspace . me . owner } -${ data . coder_workspace . me . name } -root"
97
108
server_type = var. instance_type
98
109
location = var. instance_location
99
110
image = var. instance_os
111
+ ssh_keys = [hcloud_ssh_key . root . id ]
100
112
user_data = templatefile (" cloud-config.yaml.tftpl" , {
101
113
username= data.coder_workspace.me.owner
102
114
volume_path= " /dev/disk/by-id/scsi-0HC_Volume_${ hcloud_volume . root . id } "