Skip to content

Commit

Permalink
fix use of attached_disk which tried to attach all disks
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sokołowski <[email protected]>
  • Loading branch information
jakubgs committed Oct 7, 2020
1 parent 2a84228 commit da60baa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ resource "google_compute_instance" "host" {
}

dynamic "attached_disk" {
for_each = google_compute_disk.host
for_each = var.data_vol_size > 0 ? [ google_compute_disk.host[0] ] : []
content {
device_name = "persistent-disk-${count.index+1}"
device_name = google_compute_disk.host[count.index].name
source = google_compute_disk.host[count.index].self_link
}
}
Expand Down

0 comments on commit da60baa

Please sign in to comment.