File tree Expand file tree Collapse file tree
modules/compute/vm-instance Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,7 +196,6 @@ limitations under the License.
196196| [google-beta_google_compute_resource_policy.placement_policy](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/google_compute_resource_policy) | resource |
197197| [google_compute_address.compute_ip](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_address) | resource |
198198| [google_compute_disk.additional_disks](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_disk) | resource |
199- | [google_compute_disk.boot_disk](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_disk) | resource |
200199| [null_resource.image](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
201200| [null_resource.replace_vm_trigger_from_placement](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
202201| [google_compute_image.compute_image](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_image) | data source |
Original file line number Diff line number Diff line change @@ -112,27 +112,6 @@ resource "null_resource" "image" {
112112 }
113113}
114114
115- resource "google_compute_disk" "boot_disk" {
116- project = var. project_id
117-
118- count = var. instance_count
119-
120- name = " ${ local . resource_prefix } -boot-disk-${ count . index } "
121- image = data. google_compute_image . compute_image . self_link
122- type = var. disk_type
123- size = var. disk_size_gb
124- labels = local. labels
125- zone = var. zone
126-
127- lifecycle {
128- replace_triggered_by = [null_resource. image ]
129-
130- ignore_changes = [
131- image
132- ]
133- }
134- }
135-
136115resource "google_compute_disk" "additional_disks" {
137116 project = var. project_id
138117
@@ -205,8 +184,14 @@ resource "google_compute_instance" "compute_vm" {
205184 labels = local. labels
206185
207186 boot_disk {
208- source = google_compute_disk. boot_disk [count . index ]. self_link
209- device_name = google_compute_disk. boot_disk [count . index ]. name
187+ initialize_params {
188+ image = data. google_compute_image . compute_image . self_link
189+ size = var. disk_size_gb
190+ type = var. disk_type
191+ labels = local. labels
192+ }
193+
194+ device_name = " ${ local . resource_prefix } -boot-disk-${ count . index } "
210195 auto_delete = var. auto_delete_boot_disk
211196 }
212197
You can’t perform that action at this time.
0 commit comments