@@ -193,6 +193,9 @@ func expandScheduling(v interface{}) (*compute.Scheduling, error) {
193
193
scheduling .LocalSsdRecoveryTimeout = transformedLocalSsdRecoveryTimeout
194
194
scheduling .ForceSendFields = append (scheduling .ForceSendFields , "LocalSsdRecoveryTimeout" )
195
195
}
196
+ if v , ok := original ["termination_time" ]; ok {
197
+ scheduling .TerminationTime = v .(string )
198
+ }
196
199
return scheduling , nil
197
200
}
198
201
@@ -335,6 +338,7 @@ func flattenScheduling(resp *compute.Scheduling) []map[string]interface{} {
335
338
"provisioning_model" : resp .ProvisioningModel ,
336
339
"instance_termination_action" : resp .InstanceTerminationAction ,
337
340
"availability_domain" : resp .AvailabilityDomain ,
341
+ "termination_time" : resp .TerminationTime ,
338
342
}
339
343
340
344
if resp .AutomaticRestart != nil {
@@ -776,7 +780,8 @@ func schedulingHasChangeRequiringReboot(d *schema.ResourceData) bool {
776
780
777
781
return hasNodeAffinitiesChanged (oScheduling , newScheduling ) ||
778
782
hasMaxRunDurationChanged (oScheduling , newScheduling ) ||
779
- hasGracefulShutdownChangedWithReboot (d , oScheduling , newScheduling )
783
+ hasGracefulShutdownChangedWithReboot (d , oScheduling , newScheduling ) ||
784
+ hasTerminationTimeChanged (oScheduling , newScheduling )
780
785
}
781
786
782
787
// Terraform doesn't correctly calculate changes on schema.Set, so we do it manually
@@ -828,6 +833,24 @@ func schedulingHasChangeWithoutReboot(d *schema.ResourceData) bool {
828
833
return false
829
834
}
830
835
836
+ func hasTerminationTimeChanged (oScheduling , nScheduling map [string ]interface {}) bool {
837
+ oTerminationTime := oScheduling ["termination_time" ].(string )
838
+ nTerminationTime := nScheduling ["termination_time" ].(string )
839
+
840
+ if len (oTerminationTime ) == 0 && len (nTerminationTime ) == 0 {
841
+ return false
842
+ }
843
+ if len (oTerminationTime ) == 0 || len (nTerminationTime ) == 0 {
844
+ return true
845
+ }
846
+
847
+ if oTerminationTime != nTerminationTime {
848
+ return true
849
+ }
850
+
851
+ return false
852
+ }
853
+
831
854
func hasGracefulShutdownChangedWithReboot (d * schema.ResourceData , oScheduling , nScheduling map [string ]interface {}) bool {
832
855
allow_stopping_for_update := d .Get ("allow_stopping_for_update" ).(bool )
833
856
if ! allow_stopping_for_update {
0 commit comments