Menu
AWS Systems Manager
API Reference (API Version 2014-11-06)

CreateMaintenanceWindow

Creates a new Maintenance Window.

Request Syntax

{
   "AllowUnassociatedTargets": boolean,
   "ClientToken": "string",
   "Cutoff": number,
   "Description": "string",
   "Duration": number,
   "Name": "string",
   "Schedule": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

AllowUnassociatedTargets

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.

Type: Boolean

Required: Yes

ClientToken

User-provided idempotency token.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: No

Cutoff

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

Type: Integer

Valid Range: Minimum value of 0. Maximum value of 23.

Required: Yes

Description

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Required: No

Duration

The duration of the Maintenance Window in hours.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 24.

Required: Yes

Name

The name of the Maintenance Window.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 128.

Pattern: ^[a-zA-Z0-9_\-.]{3,128}$

Required: Yes

Schedule

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: Yes

Response Syntax

{
   "WindowId": "string"
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

WindowId

The ID of the created Maintenance Window.

Type: String

Length Constraints: Fixed length of 20.

Pattern: ^mw-[0-9a-f]{17}$

Errors

For information about the errors that are common to all actions, see Common Errors.

IdempotentParameterMismatch

Error returned when an idempotent operation is retried and the parameters don't match the original call to the API with the same idempotency token.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

ResourceLimitExceededException

Error returned when the caller has exceeded the default resource limits (e.g. too many Maintenance Windows have been created).

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: