Use DeregisterTargetFromMaintenanceWindow with an Amazon SDK or CLI - Amazon Systems Manager
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use DeregisterTargetFromMaintenanceWindow with an Amazon SDK or CLI

The following code examples show how to use DeregisterTargetFromMaintenanceWindow.

CLI
Amazon CLI

To remove a target from a maintenance window

The following deregister-target-from-maintenance-window example removes the specified target from the specified maintenance window.

aws ssm deregister-target-from-maintenance-window \ --window-id "mw-ab12cd34ef56gh78" \ --window-target-id "1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d-1a2"

Output:

{ "WindowId":"mw-ab12cd34ef56gh78", "WindowTargetId":"1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d-1a2" }

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

PowerShell
Tools for PowerShell

Example 1: This example removes a target from a maintenance window.

Unregister-SSMTargetFromMaintenanceWindow -WindowTargetId "6ab5c208-9fc4-4697-84b7-b02a6cc25f7d" -WindowId "mw-06cf17cbefcb4bf4f"

Output:

WindowId WindowTargetId -------- -------------- mw-06cf17cbefcb4bf4f 6ab5c208-9fc4-4697-84b7-b02a6cc25f7d

For a complete list of Amazon SDK developer guides and code examples, see Using Systems Manager with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.