Table Of Contents


User Guide

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

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . ssm ]



Modifies the target of an existing maintenance window. You can change the following:

  • Name
  • Description
  • Owner
  • IDs for an ID target
  • Tags for a Tag target
  • From any supported tag type to another. The three supported tag types are ID target, Tag target, and resource group. For more information, see Target .


If a parameter is null, then the corresponding field is not modified.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--window-id <value>
--window-target-id <value>
[--targets <value>]
[--owner-information <value>]
[--name <value>]
[--description <value>]
[--replace | --no-replace]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--window-id (string)

The maintenance window ID with which to modify the target.

--window-target-id (string)

The target ID to modify.

--targets (list)

The targets to add or replace.

Shorthand Syntax:

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

JSON Syntax:

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

--owner-information (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)

A name for the update.

--description (string)

An optional description for the update.

--replace | --no-replace (boolean)

If True, then all fields that are required by the RegisterTargetWithMaintenanceWindow action are also required for this API request. Optional fields that are not specified are set to null.

--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. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--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.

See 'aws help' for descriptions of global parameters.


To update a maintenance window target

The following update-maintenance-window-target example updates only the name of a maintenance window target.

aws ssm update-maintenance-window-target \
    --window-id "mw-0c5ed765acEXAMPLE" \
    --window-target-id "57e8344e-fe64-4023-8191-6bf05EXAMPLE" \
    --name "NewName" \


    "Description": "",
    "OwnerInformation": "",
    "WindowTargetId": "57e8344e-fe64-4023-8191-6bf05EXAMPLE",
    "WindowId": "mw-0c5ed765acEXAMPLE",
    "Targets": [
            "Values": [
            "Key": "InstanceIds"
    "Name": "NewName"

For more information, see Update a Maintenance Window (AWS CLI) in the AWS Systems Manager User Guide.


WindowId -> (string)

The maintenance window ID specified in the update request.

WindowTargetId -> (string)

The target ID specified in the update request.

Targets -> (list)

The updated targets.


An array of search criteria that targets instances using a Key,Value combination that you specify.

Supported formats include the following.

  • ``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
  • ``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
  • ``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
  • (Maintenance window targets only) ``Key=resource-groups:Name,Values=*resource-group-name* ``
  • (Maintenance window targets only) ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``

For example:

  • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
  • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
  • Key=tag-key,Values=Name,Instance-Type,CostCenter
  • (Maintenance window targets only) Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
  • (Maintenance window targets only) ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
  • (State Manager association targets only) Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.

For information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .

Key -> (string)

User-defined criteria for sending commands that target instances that meet the criteria.

Values -> (list)

User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .


OwnerInformation -> (string)

The updated owner.

Name -> (string)

The updated name.

Description -> (string)

The updated description.