Closed displague closed 5 years ago
It feels like having a resource "linode_image"
spin up a Linode is a violation of least-surprise. It seems more viable to have this take a disk_id as input and leave it to the user to set up that disk.
It does seem like that would require adjusting the Linode_instance resource to expose disk_ids for their disks.
@akerl I like the sound of that..
resource "linode_image" "foo" {
instance_id = "${linode_instance.foo.id}"
// I believe this is currently accessible
disk_id = "${linode_instance.foo.config.0.devices.sda.0.disk_id}"
// or using a data resource, we could look up the disk id independent from any managed resource
// or, we could take this approach
disk_label = "foo"
label = "foo"
}
There are also questions of what feels right in terms of the lifecycle of an image. Should tainting the Instance (and therefor the disk_id) cause the image to be recreated, causing all the instances spawned from that image to be recreated? The lifecycle management of Terraform could be used to prevent those problems in any case.
Isn't instance_id redundant there? The API doesn't use it for CreateImage
Support Linode Image creation (perhaps) using a TF syntax like: