provider/google: add attached_disk field to google_compute_instance #13443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the minimum functionality for an
attached_disk
field.This PR is an alternative to #12398. Instead of allowing attaching/detaching of all disks and having to compare them field-by-field to determine whether a disk is the same, this field would allow only persistent disks that have been defined elsewhere in terraform to be attached/detached. This encourages better practices with terraform actually managing state. For the other solution, if a persistent disk that was created via the disks field is detached, then the disk disappears from terraform's knowledge. With a separate field, we can only allow detaching disks that terraform knows about.
Actually allowing attaching/detaching will come in a follow-up PR. This one was kept small for the sake of clarity and ease of reviewing.