Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance scheduler does not ignore disabled maintenance windows, fails to recognize active ones #99

Closed
georgematthew opened this issue Jun 19, 2019 · 3 comments

Comments

@georgematthew
Copy link

georgematthew commented Jun 19, 2019

The instance scheduler appears to get hung up on disabled maintenance windows, as they do not have a NextExecutionTime:

2019-06-19 - 13:45:12.901 - ERROR : Error loading ssm maintenace windows, ('NextExecutionTime')
2019-06-19 - 13:45:13.659 - ERROR : SSM maintenance window test-maintenance-window used in schedule AlwaysOff not found

This error was duplicated in a second AWS account by disabling an existing maintenance window and attempting to reference a second, active one in a schedule.

@georgebearden
Copy link
Member

Thank you for opening this issue, George, and sorry for the delay. I've reproduced this issue. So one option would be to keep the value of the use_maintenance_window parameter in sync with state (enabled/disabled) of the maintenance window. This isn't ideal though...

I think the better solution here would be to filter out disabled maintenance windows from the describe_maintenance_windows boto3 call as follows:

resp = ssm.describe_maintenance_windows(
        Filters=[
            {
                'Key': 'Enabled',
                'Values': [
                    'True'
                ]
            }
        ]
    )

Let me know your thoughts, and in the mean time I will be adding this bug fix to the Solutions backlog to be included in its next release.

@georgematthew
Copy link
Author

Thank you, George. I've done some testing and this appears to work - we will be updating our Lambda function code while waiting on the bugfix release.

@georgebearden
Copy link
Member

This has been incorporated into the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants