-
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 import in compute instance #873
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,3 +272,13 @@ exported: | |
* `disk.0.disk_encryption_key_sha256` - The [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4) | ||
encoded SHA-256 hash of the [customer-supplied encryption key] | ||
(https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. | ||
|
||
## Import | ||
|
||
~> **Note:** The fields `boot_disk.0.initialize_params`, `boot_disk.0.disk_entryption_raw` and `attached_disk.*.disk_encryption_key_raw` cannot be imported automatically. The API doesn't return this information. You will need to update your state manually for this field after importing the resource. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to make it extra clear, I'd say something like "If you are setting one of these fields in your config, you will need to update your state..." since not everybody is going to need to update their state. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Will do |
||
|
||
Instances can be imported using the `project`, `zone` and `name`, e.g. | ||
|
||
``` | ||
$ terraform import google_compute_instance.default gcp-project/us-central1-a/test | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be worth it to also allow users to just import by name and then rely on the provider-level project/zone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will refactor what we have done in some other resources to make it reusable and reuse it here. I wanted to keep that PR simple.