UpCloudLtd / terraform-provider-upcloud

Terraform provider for UpCloud
https://registry.terraform.io/providers/UpCloudLtd/upcloud
MIT License
60 stars 28 forks source link

ssh key resources #65

Open scippio opened 5 years ago

scippio commented 5 years ago

Please add resource for ssh key/s... thank you.

PopoSensei commented 4 years ago

Hello,

While creating a server you can add login block, which can be changed without destroying the server, though removing it all together will result in a destroy and recreate process.

So maybe my question is, for what would you need a seperate ssh key/s resource? Or maybe I answered your question?

login block example:

  # Login details
  login {
    user = "myusername"

    keys = [
      "<YOUR SSH PUBLIC KEY>",
    ]

    create_password   = true
    password_delivery = "sms"
  }
bbros-dev commented 3 years ago

TLDR;

So maybe my question is, for what would you need a seperate ssh key/s resource?

To reuse the code written for other cloud providers.

Long winded: @PopoSensei, that workaround is useful, and even a complete solution in some use cases (no-longer a workaround).

In our case we use multiple cloud vendors and to keep things managable we need to use the same code path as much as possible - in just our bootstrap module (3-cloud providers) right now we have 6,698 lines in Terraform/HCL files with 191 occurrences of ssh_key*

It simply isn't feasible to economically re-engineer everything in the way you suggest. The cost in developer cycles will be orders of magnitude larger than the saving from using Upcloud.

Most of the other Terraform resources differences we think we can work around, but not this one.

Since the issue is open we think that means upcloud may consider adding a ssh keypair resource? We hope so we need a European provider, right now it looks like Exoscale or Scaleway.

kaminek commented 3 years ago

Hello, The current API design don't allow managing ssh keys as a resource, it can be only set on server creation resource if implemented with the current version(so that could trigger a delete/start of server resource if updated).

This probably will take some time to be implemented properly.