Open mwarkentin opened 1 year ago
These resources(from_template and from_machine_image) are a little different than other standard resources because they mostly map to the API call that the resource was created through. I think it was intentional to omit this because you would be expected to import preexisting resources through google_compute_instance
. However, in the case of reused configurations that may not always make sense / be possible.
Thinking about this a bit more- what does this solve that importing by google_compute_instance
with https://developer.hashicorp.com/terraform/tutorials/state/state-import#generate-configuration doesn't? Widely reused configurations are the primary usecase I'd see but I'd be surprised if these resources were used extensively in those over google_compute_instance
modules or MIGs to manage the instance templates' instances.
Community Note
Description
It would be nice if
google_compute_instance_from_template
supportterraform import
. We had a bit of state manipulation gone wrong that left somegoogle_compute_instance_from_template
resources stranded and it turns out that we're not able to re-import them under terraform management.Are there technical reasons that
import
isn't supported, or does it just need a bit of implementation work? I assume it would look similar to the import support for a regular instance:New or Affected Resource(s)
google_compute_instance_from_template
Potential Terraform Configuration
N/A
References