krystal / terraform-provider-katapult

Terraform Provider for Katapult.
https://registry.terraform.io/providers/krystal/katapult/latest/docs
MIT License
5 stars 2 forks source link

Import katapult_virtual_machine resources #48

Open jimeh opened 3 years ago

jimeh commented 3 years ago

We currently do not support importing katapult_virtual_machine resources, as the disk_template and disk_template_options attributes are only relevant during creation, and are not returned by the API at the moment.

There are plans for the API to return these attributes, but it's not a straight forward thing, so we probably should not delay import support until it's ready.

Based on the import documentation, we probably want to use [ImportStateVerifyIgnore][2], and simply require users to define a lifecycle block with a ignore_changes attribute to avoid the disk template options from showing as changed after import.

[2]: https://www.terraform.io/docs/extend/resources/import.html#importstateverifyignore-1

It might be possible to use CustomizeDiff to suppress changes to attributes which are only available during create. I did have a very brief look into this back in December, but didn't have much luck, so I'm not sure if it's possible.

jimeh commented 1 year ago

With the planned migration in #97 to the new Plugin Framework, along with some purpose made enhancements to Katapult's Core API, this issue should become easier to resolve.

verenion commented 1 year ago

+1

The ability to import resources is something that is blocking us managing all of our resources in Terraform.