Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature request: Support for multiple SSH keys #196

Open
Breee opened this issue Jul 15, 2022 · 3 comments
Open

Feature request: Support for multiple SSH keys #196

Breee opened this issue Jul 15, 2022 · 3 comments

Comments

@Breee
Copy link

Breee commented Jul 15, 2022

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
Copy link
Member

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
Copy link

sboulkour commented May 15, 2024

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
Copy link
Member

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants