Hi Team,
Im getting below error when i trying to import existing compute engine resource via terraform import.
Import command :
terraform import ‘module.splunk_instances.module.splunk_instances.google_compute_instance["qpspldev001-test-366301"]’ qpspldev001-test-366301
Error:
╷
│ Error: Invalid address
│
│ on line 1:
│ 1: module.splunk_instances.module.splunk_instances.google_compute_instance[“qpspldev001-test-366301”]
│
│ A resource name is required.
Thanks,
Mani
Normally, just the instance name should be sufficient, at least based on the docs
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance.html
That said, the first thing I’d try is see if the extended formats mentioned there (e.g., {{project}}/{{zone}}/{{name}}
work any better. Especially if you don’t have a default zone defined at the provider level, that may do the trick.
If that doesn’t work, you may want to try running with TF_LOG
set to debug
and / or file a provider bug.