diff --git a/builtin/providers/google/resource_compute_instance_template.go b/builtin/providers/google/resource_compute_instance_template.go index ec85f1ba6fab..69432ec745b2 100644 --- a/builtin/providers/google/resource_compute_instance_template.go +++ b/builtin/providers/google/resource_compute_instance_template.go @@ -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, @@ -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++ {