Table Of Contents

Feedback

User Guide

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

[ aws . ssm ]

update-maintenance-window-target

Description

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 .

Note

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.

Synopsis

  update-maintenance-window-target
--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>]

Options

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

Examples

To update a Maintenance Window target

This example updates the name of a Maintenance Window target.

Command:

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

Output:

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

Output

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.

(structure)

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
  • (Maintenance window targets only) ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* ``

For information about how to send commands that target instances using Key,Value parameters, see Using Targets and Rate Controls to Send Commands to a Fleet 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 Amazon EC2 tags of ServerRole,WebServer .

(string)

OwnerInformation -> (string)

The updated owner.

Name -> (string)

The updated name.

Description -> (string)

The updated description.