CmdID

CmdID / aws / aws ssm

aws ssm describe-maintenance-windows

Retrieves the maintenance windows in an Amazon Web Services account. AWS CLI reference

3 examples 3 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To list all maintenance windows

The following describe-maintenance-windows example lists all maintenance windows in your AWS account in the current Region.

aws ssm describe-maintenance-windowsIdentify
Its output
{
    "WindowIdentities": [
        {
            "WindowId": "mw-0ecb1226ddEXAMPLE",
            "Name": "MyMaintenanceWindow-1",
            "Enabled": true,
            "Duration": 2,
            "Cutoff": 1,
            "Schedule": "rate(180 minutes)",
            "NextExecutionTime": "2020-02-12T23:19:20.596Z"
        },
        {
            "WindowId": "mw-03eb9db428EXAMPLE",
            "Name": "MyMaintenanceWindow-2",
            "Enabled": true,
            "Duration": 3,
            "Cutoff": 1,
            "Schedule": "rate(7 days)",
            "NextExecutionTime": "2020-02-17T23:22:00.956Z"
        },
        {
            "WindowId": "mw-1a2b3c4d5eEXAMPLE",
            "Name": "MyMaintenanceWindow",
            "Enabled": false,
            "Duration": 2,
            "Cutoff": 0,
            "Schedule": "cron(0 16 ? * TUE *)"
        }
    ]
}

Example 2: To list all enabled maintenance windows

The following describe-maintenance-windows example lists all enabled maintenance windows.

aws ssm describe-maintenance-windows --filters "Key=Enabled,Values=true"Identify
--filtersOptional filters used to narrow down the scope of the returned maintenance windows.
Its output
{
    "WindowIdentities": [
        {
            "WindowId": "mw-0ecb1226ddEXAMPLE",
            "Name": "MyMaintenanceWindow-1",
            "Enabled": true,
            "Duration": 2,
            "Cutoff": 1,
            "Schedule": "rate(180 minutes)",
            "NextExecutionTime": "2020-02-12T23:19:20.596Z"
        },
        {
            "WindowId": "mw-03eb9db428EXAMPLE",
            "Name": "MyMaintenanceWindow-2",
            "Enabled": true,
            "Duration": 3,
            "Cutoff": 1,
            "Schedule": "rate(7 days)",
            "NextExecutionTime": "2020-02-17T23:22:00.956Z"
        }
    ]
}

Example 3: To list maintenance windows matching a specific name

The following describe-maintenance-windows example lists all maintenance windows with the specified name.

aws ssm describe-maintenance-windows --filters "Key=Name,Values=MyMaintenanceWindow"Identify
--filtersOptional filters used to narrow down the scope of the returned maintenance windows.
Its output
{
    "WindowIdentities": [
        {
            "WindowId": "mw-1a2b3c4d5eEXAMPLE",
            "Name": "MyMaintenanceWindow",
            "Enabled": false,
            "Duration": 2,
            "Cutoff": 0,
            "Schedule": "cron(0 16 ? * TUE *)"
        }
    ]
}

For more information, see View Information About Maintenance Windows (AWS CLI) in the AWS Systems Manager User Guide.

Options

3 in the AWS CLI reference
--filtersOptional filters used to narrow down the scope of the returned maintenance windows.
--max-resultsThe maximum number of items to return for this call.
--next-tokenThe token for the next set of items to return.