Tagging maintenance windows - 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).

Tagging maintenance windows

The topics in this section describe how to work with tags on maintenance windows.

Creating maintenance windows with tags

You can add tags to maintenance windows at the time you create them.

For information, see the following topics:

Adding tags to existing maintenance windows

You can add tags to maintenance windows that you own by using the Amazon Systems Manager console or the command line.

Adding tags to an existing maintenance window (console)

  1. Open the Amazon Systems Manager console at https://console.amazonaws.cn/systems-manager/.

  2. In the navigation pane, choose Maintenance Windows.

    -or-

    If the Amazon Systems Manager home page opens first, choose the menu icon ( 
    The menu icon
  ) to open the navigation pane, and then choose Maintenance Windows.

  3. Choose the name of a maintenance window you have already created, and then choose the Tags tabs.

  4. Choose Edit tags, and then choose Add tag.

  5. For Key, enter a key for the tag, such as Environment.

  6. For Value, enter a value for the tag, such as Test.

  7. Choose Save changes.

Adding tags to an existing maintenance window (Amazon CLI)

  1. Using your preferred command line tool, run the following command to view the list of maintenance windows that you can tag.

    aws ssm describe-maintenance-windows

    Note the ID of a maintenance window that you want to tag.

  2. Run the following command to tag a maintenance window. Replace each example resource placeholder with your own information.

    Linux & macOS
    aws ssm add-tags-to-resource \ --resource-type "MaintenanceWindow" \ --resource-id "window-id" \ --tags "Key=tag-key,Value=tag-value"
    Windows
    aws ssm add-tags-to-resource ^ --resource-type "MaintenanceWindow" ^ --resource-id "window-id" ^ --tags "Key=tag-key,Value=tag-value"

    If successful, the command has no output.

  3. Run the following command to verify the maintenance window tags.

    Linux & macOS
    aws ssm list-tags-for-resource \ --resource-type "MaintenanceWindow" \ --resource-id "window-id"
    Windows
    aws ssm list-tags-for-resource ^ --resource-type "MaintenanceWindow" ^ --resource-id "window-id"

Tag a maintenance window (Amazon Tools for PowerShell)

  1. Run the following command to list maintenance windows that you can tag.

    Get-SSMMaintenanceWindow
  2. Run the following commands to tag a maintenance window.

    $tag = New-Object Amazon.SimpleSystemsManagement.Model.Tag
    $tag.Key = "tag-key"
    $tag.Value = "tag-value"
    Add-SSMResourceTag ` -ResourceType "MaintenanceWindow" ` -ResourceId "window-id" ` -Tag $tag

    window-id the ID of the maintenance window you want to tag.

    tag-key is the name of a custom key you supply. For example, Environment or Project.

    tag-value is the custom content for the value you want to supply for that key. For example, Production or Q321.

  3. Run the following command to verify the maintenance window tags.

    Get-SSMResourceTag ` -ResourceType "MaintenanceWindow" ` -ResourceId "window-id"

Removing tags from maintenance windows

You can use the Systems Manager console or the command line to remove tags from maintenance windows.

Removing tags from maintenance windows (console)

  1. Open the Amazon Systems Manager console at https://console.amazonaws.cn/systems-manager/.

  2. In the navigation pane, choose Maintenance Windows.

    -or-

    If the Amazon Systems Manager home page opens first, choose the menu icon ( 
    The menu icon
  ) to open the navigation pane, and then choose Maintenance Windows.

  3. Choose the name of the maintenance window to remove tags from, and then choose Tags tab.

  4. Choose Edit tags, and then choose Remove tag next to the tag pair you no longer need.

  5. Choose Save changes.

Removing tags from maintenance windows (command line)

  1. Using your preferred command line tool, run the following command to list the maintenance windows in your account.

    Linux & macOS
    aws ssm describe-maintenance-windows
    Windows
    aws ssm describe-maintenance-windows
    PowerShell
    Get-SSMMaintenanceWindows

    Note the ID of a maintenance window from which you want to remove tags.

  2. Run the following command to remove tags from a maintenance window. Replace each example resource placeholder with your own information.

    Linux & macOS
    aws ssm remove-tags-from-resource \ --resource-type "MaintenanceWindow" \ --resource-id "window-id" \ --tag-key "tag-key"
    Windows
    aws ssm remove-tags-from-resource ^ --resource-type "MaintenanceWindow" ^ --resource-id "window-id" ^ --tag-key "tag-key"
    PowerShell
    Remove-SSMResourceTag ` -ResourceType "MaintenanceWindow" ` -ResourceId "window-id" ` -TagKey "tag-key

    If successful, the command has no output.

  3. Run the following command to verify the maintenance window tags.

    Linux & macOS
    aws ssm list-tags-for-resource \ --resource-type "MaintenanceWindow" \ --resource-id "window-id"
    Windows
    aws ssm list-tags-for-resource ^ --resource-type "MaintenanceWindow" ^ --resource-id "window-id"
    PowerShell
    Get-SSMResourceTag ` -ResourceType "MaintenanceWindow" ` -ResourceId "window-id"