CmdID

CmdID / aws / aws ssm

aws ssm describe-maintenance-window-targets

Lists the targets registered with the maintenance window. AWS CLI reference

2 examples 4 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 targets for a Maintenance Window

The following describe-maintenance-window-targets example lists all of the targets for a maintenance window.

aws ssm describe-maintenance-window-targets --window-id "mw-06cf17cbefEXAMPLE"Identify
--window-idThe ID of the maintenance window whose targets should be retrieved.
Its output, shortened
{
    "Targets": [
        {
            "ResourceType": "INSTANCE",
            "OwnerInformation": "Single instance",
            "WindowId": "mw-06cf17cbefEXAMPLE",
            "Targets": [
                {
                    "Values": [
                        "i-0000293ffdEXAMPLE"
                    ],
                    "Key": "InstanceIds"
                }
            ],
            "WindowTargetId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
        },
        {
            "ResourceType": "INSTANCE",
            "OwnerInformation": "Two instances in a list",
            "WindowId": "mw-06cf17cbefEXAMPLE",
            "Targets": [
                {
                    "Values": [
                        "i-0000293ffdEXAMPLE",
                        "i-0cb2b964d3EXAMPLE"
                    ],
                    "Key": "InstanceIds"
                }
            ],
            "WindowTargetId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222"
… 3 more lines

Example 2: To list all targets for a maintenance window matching a specific owner information value

The following describe-maintenance-window-targets example lists all of the targets for a maintenance window with a specific value.

aws ssm describe-maintenance-window-targets --window-id "mw-0ecb1226ddEXAMPLE" --filters "Key=OwnerInformation,Values=CostCenter1"Identify
--window-idThe ID of the maintenance window whose targets should be retrieved.
--filtersOptional filters that can be used to narrow down the scope of the returned window targets.
Its output
{
    "Targets": [
        {
            "WindowId": "mw-0ecb1226ddEXAMPLE",
            "WindowTargetId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
            "ResourceType": "INSTANCE",
            "Targets": [
                {
                    "Key": "tag:Environment",
                    "Values": [
                        "Prod"
                    ]
                }
            ],
            "OwnerInformation": "CostCenter1",
            "Name": "ProdTarget1"
        }
    ]
}

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

Options

4 in the AWS CLI reference
--filtersOptional filters that can be used to narrow down the scope of the returned window targets.
--max-resultsThe maximum number of items to return for this call.
--next-tokenThe token for the next set of items to return.
--window-idThe ID of the maintenance window whose targets should be retrieved.