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]: Assign block storage to instance #360

Open various89 opened 1 month ago

various89 commented 1 month ago

What feature would you like to have in the provider?

It would be nice to have the capability to attach the created volume to a specific instance or server.

e.g.

resource "exoscale_block_storage_volume" "example" {
  name  = var.name
  size  = var.size
  zone  = var.zone
  server_id = var.server_id
}

other providers for reference:

https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/volume#server_id https://registry.terraform.io/providers/ionos-cloud/ionoscloud/latest/docs/resources/volume#server_id

sauterp commented 1 month ago

Hi, thanks for the request. We do provide this functionality in the exoscale_compute_instance resource https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/resources/compute_instance#block_storage_volume_ids

I'm closing this, but feel free to reply if I misunderstood and we'll reopen this.

various89 commented 1 month ago

Hi,

thanks I'm aware of the functionality provided in the exoscale_compute_instance. It would be beneficial to have this functionality in both directions, instance -> volume and volume -> instance.

Thinking of circular dependencies, at least in our project, are harder to resolve if this functionality is only implemented in one direction.

sauterp commented 1 month ago

I'm not sure I understand, doesn't the fact that the functionality is not implemented in both directions prevent circular dependencies?

Perhaps you can share more details about your use case to make this clearer?

greut commented 1 month ago

How does Terraform handle moving a volume from one instance to another without that?