Table Of Contents

Feedback

User Guide

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

[ aws . ssm ]

create-maintenance-window

Description

Creates a new Maintenance Window.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-maintenance-window
--name <value>
[--description <value>]
[--start-date <value>]
[--end-date <value>]
--schedule <value>
[--schedule-timezone <value>]
--duration <value>
--cutoff <value>
--allow-unassociated-targets | --no-allow-unassociated-targets
[--client-token <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--name (string)

The name of the Maintenance Window.

--description (string)

An optional description for the Maintenance Window. We recommend specifying a description to help you organize your Maintenance Windows.

--start-date (string)

The date and time, in ISO-8601 Extended format, for when you want the Maintenance Window to become active. StartDate allows you to delay activation of the Maintenance Window until the specified future date.

--end-date (string)

The date and time, in ISO-8601 Extended format, for when you want the Maintenance Window to become inactive. EndDate allows you to set a date and time in the future when the Maintenance Window will no longer run.

--schedule (string)

The schedule of the Maintenance Window in the form of a cron or rate expression.

--schedule-timezone (string)

The time zone that the scheduled Maintenance Window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.

--duration (integer)

The duration of the Maintenance Window in hours.

--cutoff (integer)

The number of hours before the end of the Maintenance Window that Systems Manager stops scheduling new tasks for execution.

--allow-unassociated-targets | --no-allow-unassociated-targets (boolean)

Enables a Maintenance Window task to execute on managed instances, even if you have not registered those instances as targets. If enabled, then you must specify the unregistered instances (by instance ID) when you register a task with the Maintenance Window

If you don't enable this option, then you must specify previously-registered targets when you register a task with the Maintenance Window.

--client-token (string)

User-provided idempotency token.

--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 create a maintenance window

This example creates a new maintenance window with the specified name that runs at 4 PM on every Tuesday for 4 hours, with a 1 hour cutoff, and that allows unassociated targets.

Command:

aws ssm create-maintenance-window --name "My-First-Maintenance-Window" --schedule "cron(0 16 ? * TUE *)" --duration 4 --cutoff 1 --allow-unassociated-targets

Output:

{
      "WindowId": "mw-ab12cd34ef56gh78"
}

Output

WindowId -> (string)

The ID of the created Maintenance Window.