Maintenance window's "NextExecutionTime" is updated as soon as execution begins, causing instances to be shut down at the next scheduler interval
See original GitHub issueAfter working around #99 and #100, I am still unable to use the SSM maintenance window functionality. I’ve attempted to outline the behavior I am seeing below. Please let me know if I can elaborate on anything.
-
The instances that are configured with a schedule that references a maintenance window are started at least 10 minutes before the maintenance window based on the schedule/period created from the maintenance window’s
NextExecutionTime
. The running period is 2 hours in duration, as expected. This matches the maintenance window duration. -
The SSM maintenance window tasks begin. By this time the instances are running and recognized by SSM. I am executing Run Command tasks to run the
AWS-UpdateSSMAgent
andAWS-RunPatchBaseline
documents. -
At the next scheduler interval (10 minutes later, for example), the instances are stopped because the scheduler has created a new schedule/period based on the maintenance window’s updated
NextExecutionTime
. It appears that the previously created period/schedule is overwritten and the scheduler believes that the desired state is “stopped”. In my case, theNextExecutionTime
is one week in the future, as the maintenance window is scheduled once per week. This causes the pending Run Command tasks to fail and tasks that have yet to start to reportNoInstancesInTag
.
The expected behavior is that the scheduler would keep the instances running for the duration of the maintenance window.
Is this a bug in the scheduler’s maintenance window functionality or am I failing to understand something about how this solution is intended to be used?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
This issue has been fixed in the release 1.3.1. Please deploy the latest template to get the updated code.
I can confirm I am seeing the exact same behavior as @georgematthew. Using 1.3 and a schedule that is effectively always off other than the ssm maintenance period.