AWS Systems Manager
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Assign Tasks to a Maintenance Window (Console)

In this procedure, you add a task to a maintenance window. Tasks are the actions performed on a resource during a maintenance window execution.

The following four types of tasks can be added to a maintenance window:

  • Systems Manager Run Command commands

  • Systems Manager Automation workflows

  • AWS Lambda functions

  • AWS Step Functions tasks

To assign tasks to a maintenance window

  1. In the list of maintenance windows, choose a maintenance window .

  2. Choose Actions and then,choose the option for the type of task you want to register with the maintenance window:

    • Register Run command task

    • Register Automation task

    • Register Lambda task

    • Register Step Functions task

  3. For Name, enter a name for the task.

  4. For Description, enter a description.

  5. For Document, choose the SSM Command or Automation document that defines the tasks to run.

  6. For Document version (for Automation tasks), choose the document version to use.

  7. For Task priority, specify a priority for this task. 1 is the highest priority. Tasks in a maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel.

  8. In the Targets section, identify the instances on which you want to run this operation by specifying tags, selecting instances manually, or specifying a resource group.

    Note

    If you choose to select instances manually, and an instance you expect to see is not included in the list, see Where Are My Instances? for troubleshooting tips.

  9. (Optional) For Rate control:

    • For Concurrency, specify either a number or a percentage of instances on which to run the command at the same time.

      Note

      If you selected targets by specifying tags applied to managed instances or by specifying AWS resource groups, and you are not certain how many instances are targeted, then limit the number of instances that can run the document at the same time by specifying a percentage.

    • For Error threshold, specify when to stop running the command on other instances after it fails on either a number or a percentage of instances. For example, if you specify three errors, then Systems Manager stops sending the command when the fourth error is received. Instances still processing the command might also send errors.

  10. In the IAM service role area, choose one of the following options to provide permissions for Systems Manager to run tasks on your target instances:

    • Create and use a service-linked role for Systems Manager

      Service-linked roles provide a secure way to delegate permissions to AWS services because only the linked service can assume a service-linked role. Additionally, AWS automatically defines and sets the permissions of service-linked roles, depending on the actions that the linked service performs on your behalf.

      Note

      If a service-linked role has already been created for your account, choose Use the service-linked role for Systems Manager.

    • Use a custom service role

      You can create a custom service role for maintenance window tasks if you want to use stricter permissions than those provided by the service-linked role. Or you can create a custom service role if you want to use Amazon SNS to send notifications related to maintenance window tasks run through Run Command

      If you need to create a custom service role, see one of the following topics:

    To help you decide whether to use a custom service role or the Systems Manager service-linked role with a maintenance window task, see Should I Use a Service-Linked Role or a Custom Service Role to Run Maintenance Window Tasks?.

  11. In the Input Parameters section, specify parameters for the document. For Automation documents, the system auto-populates some of the values. You can keep or replace these values.

  12. Complete the wizard.