Is your feature request related to a problem? Please describe.
It would be nice to avoid stopping an instance when certain conditions are met, for exmple if a user leaves a long-running job on an instance it would be nice to skip (or defer) the stopping of that instance so that the computation would be allowed to complete.
Describe the feature you'd like
If CPU utilisation was a suitably general measure of 'in use' then there could be a tag on the instance with a CPU value and if the utilisation is above that value then the stopping of the instance is skipped.
A more general solution might be to use a tag value that includes a CloudWatch metric name, a comparison operator and a value. If this condition evaluates to true, then skip the instance.
In the most simple scenario this would mean that the instance is not stopped until the next time the schedule determines that it should be stopped thus avoiding any intermediate retry of deferred stops.
Additional context
It occurs to me that defining a maintenance window to avoid the stopping of the instance might provide a approach to solving for this however the creation of that maintenance window would have to be automated in order to avoid the overhead of setting it on an instance-by-instance basis. The duration of the window could be defined using another tag so that the user could determine a maximum time for which the stopping of the instance would be skipped..
Is your feature request related to a problem? Please describe. It would be nice to avoid stopping an instance when certain conditions are met, for exmple if a user leaves a long-running job on an instance it would be nice to skip (or defer) the stopping of that instance so that the computation would be allowed to complete.
Describe the feature you'd like If CPU utilisation was a suitably general measure of 'in use' then there could be a tag on the instance with a CPU value and if the utilisation is above that value then the stopping of the instance is skipped.
A more general solution might be to use a tag value that includes a CloudWatch metric name, a comparison operator and a value. If this condition evaluates to true, then skip the instance.
In the most simple scenario this would mean that the instance is not stopped until the next time the schedule determines that it should be stopped thus avoiding any intermediate retry of deferred stops.
Additional context
It occurs to me that defining a maintenance window to avoid the stopping of the instance might provide a approach to solving for this however the creation of that maintenance window would have to be automated in order to avoid the overhead of setting it on an instance-by-instance basis. The duration of the window could be defined using another tag so that the user could determine a maximum time for which the stopping of the instance would be skipped..