-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support google_compute_instance import #369
Comments
Related to #182 which is to add import support for all compute resources. |
Also related to #329 which does a migration to the new fields to avoid the destroy/create you noticed. |
Thanks for finding time to look into this issue, |
Hopefully within the next week or two, but it's hard to know. |
We have been waiting this feature for a month... |
Is there any news for this feature ? |
I guess this open issue is related to what I am noticing as well, I am on $ terraform --version
and trying to do, $ terraform import google_compute_instance.ac01 ac01
Logs... |
@lkr2des You are correct. This error message shows up because the feature is not supported yet. It won't be possible to import the metadata field correctly without a breaking change but I can still support import for all the other field. After the import, it will show a diff for the metadata field but since metadata supports update, it shouldn't be a big deal. I suggest we do it in 2 parts:
|
@rosbo I'm currently using the instance import feature with great success, thanks for this addition! One thing I'm noticing is that metadata isn't getting imported (just metadata_startup_script). Does your comment above mean that it currently does not support importing metadata, and it'll be a while until this is supported? I can copy-paste from the google api to get this into terraform, but just curious if this was why I wasn't able to get it working. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
The initial idea was to try to update the configuration for google compute disks:
disk
==>boot_disk
/attached_disk
as required in version 10 to prevent all the deprecation errors, however this action involves destroying disk and the instance and then re-provision them.To avoid re-provisioning I thought we can manually remove all the resources from the state and re-import them on by one with the new configuration. Unfortunately importing
google_compute_instance
is currently not supported. I think we will stay with deprecation warnings and wait until this issue is resolve to update our config .Terraform Version
Terraform v0.10.2
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/nikoren/887544482ab7597789b36b08a021a3af
Panic Output
Expected Behavior
Compute instance should be imported
Actual Behavior
Get error
Steps to Reproduce
gce_compute_instance
terraform state rm gce_compute_instance.name
terraform import google_compute_instance.compute-recommendation ${instance_id}
The text was updated successfully, but these errors were encountered: