exoscale / terraform-provider-exoscale

Terraform Exoscale provider
https://www.terraform.io/docs/providers/exoscale/
Mozilla Public License 2.0
28 stars 24 forks source link

Feature request: Support for multiple SSH keys #196

Open Breee opened 1 year ago

Breee commented 1 year ago

Currently it's only possible to pass a single SSH key (At least according to the documentation)

resource "exoscale_compute_instance" "compute_demo_server" {
  zone        = local.zone
  name        = "compute-demo-server"
  type        = "standard.micro"
  template_id = data.exoscale_compute_template.ubuntu.id
  disk_size   = 10
  security_group_ids = [
    exoscale_security_group.external-ssh.id,
  ]
  ssh_key     = "alice"
  user_data   = <<EOF
#cloud-config
package_upgrade: true
EOF
}

It would be useful to pass multiple keys as a list, similar to hetzner, e.g.

ssh_keys     = ["alice", "bob"]
PhilippeChepy commented 1 year ago

Hello @Breee,

You are right: for now, we don't support specifying more than 1 ssh authorized_key in the ssh_key attribute of the exoscale_compute_instance. We will discuss this limitation internally as it's not tied to the Terraform provider but also to our API.

In the meantime, you can work around this limitation by setting authorized ssh keys through cloud-init, given the public keys you want to allow to connect to the instance.

sboulkour commented 1 month ago

Hi @PhilippeChepy , I wanted to read some of my SSH public keys stored in Exoscale to generate my user_data block within tofu code as suggested. But I couldn't find a datasource that allows me to get my keys from Exoscale.

pierre-emmanuelJ commented 3 weeks ago

Hello :) @Breee @sboulkour we are now supporting multiple SSH key for an instance in the API https://openapi-v2.exoscale.com/operation/operation-create-instance#operation-create-instance-body-application-json-ssh-keys

For now no ETA to implementing it in the Terraform provider, but you will be informed here once the things will move. Thanks