Skip to content

Commit

Permalink
provider/google: Added preemtible flag to instance_template
Browse files Browse the repository at this point in the history
  • Loading branch information
lwander committed Oct 28, 2015
1 parent f1c6673 commit af098df
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions builtin/providers/google/resource_compute_instance_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ func resourceComputeInstanceTemplate() *schema.Resource {
ForceNew: true,
},

"preemptible": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
},

"service_account": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -360,6 +366,10 @@ func resourceComputeInstanceTemplateCreate(d *schema.ResourceData, meta interfac
instanceProperties.Scheduling.OnHostMaintenance = v.(string)
}

if v, ok := d.GetOk("preemptible"); ok {
instanceProperties.Scheduling.Preemptible = v.(bool)
}

serviceAccountsCount := d.Get("service_account.#").(int)
serviceAccounts := make([]*compute.ServiceAccount, 0, serviceAccountsCount)
for i := 0; i < serviceAccountsCount; i++ {
Expand Down

0 comments on commit af098df

Please sign in to comment.