Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ssm ]

describe-maintenance-window-targets

Description

Lists the targets registered with the Maintenance Window.

See also: AWS API Documentation

Synopsis

  describe-maintenance-window-targets
--window-id <value>
[--filters <value>]
[--max-results <value>]
[--next-token <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--window-id (string)

The ID of the Maintenance Window whose targets should be retrieved.

--filters (list)

Optional filters that can be used to narrow down the scope of the returned window targets. The supported filter keys are Type, WindowTargetId and OwnerInformation.

Shorthand Syntax:

Key=string,Values=string,string ...

JSON Syntax:

[
  {
    "Key": "string",
    "Values": ["string", ...]
  }
  ...
]

--max-results (integer)

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

--next-token (string)

The token for the next set of items to return. (You received this token from a previous call.)

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

Examples

To list all targets for a maintenance window

This example lists all of the targets for a maintenance window.

Command:

aws ssm describe-maintenance-window-targets --window-id "mw-06cf17cbefcb4bf4f"

Output:

{
  "Targets": [
      {
          "ResourceType": "INSTANCE",
          "OwnerInformation": "Single instance",
          "WindowId": "mw-06cf17cbefcb4bf4f",
          "Targets": [
              {
                  "Values": [
                      "i-0000293ffd8c57862"
                  ],
                  "Key": "InstanceIds"
              }
          ],
          "WindowTargetId": "350d44e6-28cc-44e2-951f-4b2c985838f6"
      },
      {
          "ResourceType": "INSTANCE",
          "OwnerInformation": "Two instances in a list",
          "WindowId": "mw-06cf17cbefcb4bf4f",
          "Targets": [
              {
                  "Values": [
                      "i-0000293ffd8c57862",
                      "i-0cb2b964d3e14fd9f"
                  ],
                  "Key": "InstanceIds"
              }
          ],
          "WindowTargetId": "e078a987-2866-47be-bedd-d9cf49177d3a"
      }
  ]
}

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

This example lists all of the targets for a maintenance window with a specific value.

Command:

aws ssm describe-maintenance-window-targets --window-id "mw-ab12cd34ef56gh78" --filters "Key=OwnerInformation,Values=Single instance"

Output

Targets -> (list)

Information about the targets in the Maintenance Window.

(structure)

The target registered with the Maintenance Window.

WindowId -> (string)

The Maintenance Window ID where the target is registered.

WindowTargetId -> (string)

The ID of the target.

ResourceType -> (string)

The type of target.

Targets -> (list)

The targets (either instances or tags). Instances are specified using Key=instanceids,Values=instanceid1,instanceid2. Tags are specified using Key=tag name,Values=tag value.

(structure)

An array of search criteria that targets instances using a Key,Value combination that you specify. Targets is required if you don't provide one or more instance IDs in the call.

Key -> (string)

User-defined criteria for sending commands that target instances that meet the criteria. Key can be tag:Amazon EC2 tagor InstanceIds. For more information about how to send commands that target instances using Key,Value parameters, see Executing a Command Using Systems Manager Run Command .

Values -> (list)

User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to execute a command on instances that include Amazon EC2 tags of ServerRole,WebServer. For more information about how to send commands that target instances using Key,Value parameters, see Executing a Command Using Systems Manager Run Command .

(string)

OwnerInformation -> (string)

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

Name -> (string)

The target name.

Description -> (string)

A description of the target.

NextToken -> (string)

The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.