Skip to content

Commit

Permalink
Add error if boot disk specified on non-first disk in instance template
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick committed Jan 24, 2020
1 parent 94b406f commit 81f28a4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ func buildDisks(d *schema.ResourceData, config *Config) ([]*computeBeta.Attached
disk.AutoDelete = d.Get(prefix + ".auto_delete").(bool)

if v, ok := d.GetOk(prefix + ".boot"); ok {
if v.(bool) && i != 0 {
return nil, fmt.Errorf("Only the first disk specified in instance_template can be a boot disk")
}
disk.Boot = v.(bool)
}

Expand Down

0 comments on commit 81f28a4

Please sign in to comment.