UpdateMaintenanceWindow - AWS Systems Manager

UpdateMaintenanceWindow

Updates an existing maintenance window. Only specified parameters are modified.

Note

The value you specify for Duration determines the specific end time for the maintenance window based on the time it begins. No maintenance window tasks are permitted to start after the resulting endtime minus the number of hours you specify for Cutoff. For example, if the maintenance window starts at 3 PM, the duration is three hours, and the value you specify for Cutoff is one hour, no maintenance window tasks can start after 5 PM.

Request Syntax

{ "AllowUnassociatedTargets": boolean, "Cutoff": number, "Description": "string", "Duration": number, "Enabled": boolean, "EndDate": "string", "Name": "string", "Replace": boolean, "Schedule": "string", "ScheduleOffset": number, "ScheduleTimezone": "string", "StartDate": "string", "WindowId": "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

Whether targets must be registered with the maintenance window before tasks can be defined for those targets.

Type: Boolean

Required: No

Cutoff

The number of hours before the end of the maintenance window that AWS Systems Manager stops scheduling new tasks for execution.

Type: Integer

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

Required: No

Description

An optional description for the update request.

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: No

Enabled

Whether the maintenance window is enabled.

Type: Boolean

Required: No

EndDate

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.

Type: String

Required: No

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: No

Replace

If True, then all fields that are required by the CreateMaintenanceWindow operation are also required for this API request. Optional fields that aren't specified are set to null.

Type: Boolean

Required: No

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: No

ScheduleOffset

The number of days to wait after the date and time specified by a cron expression before running the maintenance window.

For example, the following cron expression schedules a maintenance window to run the third Tuesday of every month at 11:30 PM.

cron(30 23 ? * TUE#3 *)

If the schedule offset is 2, the maintenance window won't run until two days later.

Type: Integer

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

Required: No

ScheduleTimezone

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

Type: String

Required: No

StartDate

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.

Note

When using a rate schedule, if you provide a start date that occurs in the past, the current date and time are used as the start date.

Type: String

Required: No

WindowId

The ID of the maintenance window to update.

Type: String

Length Constraints: Fixed length of 20.

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

Required: Yes

Response Syntax

{ "AllowUnassociatedTargets": boolean, "Cutoff": number, "Description": "string", "Duration": number, "Enabled": boolean, "EndDate": "string", "Name": "string", "Schedule": "string", "ScheduleOffset": number, "ScheduleTimezone": "string", "StartDate": "string", "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.

AllowUnassociatedTargets

Whether targets must be registered with the maintenance window before tasks can be defined for those targets.

Type: Boolean

Cutoff

The number of hours before the end of the maintenance window that AWS Systems Manager stops scheduling new tasks for execution.

Type: Integer

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

Description

An optional description of the update.

Type: String

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

Duration

The duration of the maintenance window in hours.

Type: Integer

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

Enabled

Whether the maintenance window is enabled.

Type: Boolean

EndDate

The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become inactive. The maintenance window won't run after this specified time.

Type: String

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}$

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.

ScheduleOffset

The number of days to wait to run a maintenance window after the scheduled cron expression date and time.

Type: Integer

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

ScheduleTimezone

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

Type: String

StartDate

The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become active. The maintenance window won't run before this specified time.

Type: String

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.

DoesNotExistException

Error returned when the ID specified for a resource, such as a maintenance window or patch baseline, doesn't exist.

For information about resource quotas in AWS Systems Manager, see Systems Manager service quotas in the Amazon Web Services General Reference.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

Examples

Example

This example illustrates one usage of UpdateMaintenanceWindow.

Sample Request

POST / HTTP/1.1 Host: ssm.us-east-2.amazonaws.com Accept-Encoding: identity Content-Length: 160 X-Amz-Target: AmazonSSM.UpdateMaintenanceWindow X-Amz-Date: 20240312T203703Z User-Agent: aws-cli/1.11.180 Python/2.7.9 Windows/8 botocore/1.7.38 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20240312/us-east-2/ssm/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE { "Duration": 10, "WindowId": "mw-0c50858d01EXAMPLE", "Name": "Default-Maintenance-Window", "Description": "Standard maintenance windows for production servers" }

Sample Response

{ "AllowUnassociatedTargets": true, "Cutoff": 4, "Description": "Standard maintenance windows for production servers", "Duration": 10, "Enabled": true, "Name": "Default-Maintenance-Window", "Schedule": "rate(3 minutes)", "WindowId": "mw-0c50858d01EXAMPLE" }

See Also

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