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

UpdateMaintenanceWindowTask

Modifies a task assigned to a Maintenance Window. You can't change the task type, but you can change the following values:

Task ARN. For example, you can change a RUN_COMMAND task from AWS-RunPowerShellScript to AWS-RunShellScript.

Service role ARN.

Task parameters.

Task priority.

Task MaxConcurrency and MaxErrors.

Log location.

If a parameter is null, then the corresponding field is not modified. Also, if you set Replace to true, then all fields required by the RegisterTaskWithMaintenanceWindow action are required for this request. Optional fields that aren't specified are set to null.

Request Syntax

{
   "Description": "string",
   "LoggingInfo": { 
      "S3BucketName": "string",
      "S3KeyPrefix": "string",
      "S3Region": "string"
   },
   "MaxConcurrency": "string",
   "MaxErrors": "string",
   "Name": "string",
   "Priority": number,
   "Replace": boolean,
   "ServiceRoleArn": "string",
   "Targets": [ 
      { 
         "Key": "string",
         "Values": [ "string" ]
      }
   ],
   "TaskArn": "string",
   "TaskInvocationParameters": { 
      "Automation": { 
         "DocumentVersion": "string",
         "Parameters": { 
            "string" : [ "string" ]
         }
      },
      "Lambda": { 
         "ClientContext": "string",
         "Payload": blob,
         "Qualifier": "string"
      },
      "RunCommand": { 
         "Comment": "string",
         "DocumentHash": "string",
         "DocumentHashType": "string",
         "NotificationConfig": { 
            "NotificationArn": "string",
            "NotificationEvents": [ "string" ],
            "NotificationType": "string"
         },
         "OutputS3BucketName": "string",
         "OutputS3KeyPrefix": "string",
         "Parameters": { 
            "string" : [ "string" ]
         },
         "ServiceRoleArn": "string",
         "TimeoutSeconds": number
      },
      "StepFunctions": { 
         "Input": "string",
         "Name": "string"
      }
   },
   "TaskParameters": { 
      "string" : { 
         "Values": [ "string" ]
      }
   },
   "WindowId": "string",
   "WindowTaskId": "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.

Description

The new task description to specify.

Type: String

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

Required: No

LoggingInfo

The new logging location in Amazon S3 to specify.

Type: LoggingInfo object

Required: No

MaxConcurrency

The new MaxConcurrency value you want to specify. MaxConcurrency is the number of targets that are allowed to run this task in parallel.

Type: String

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

Pattern: ^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$

Required: No

MaxErrors

The new MaxErrors value to specify. MaxErrors is the maximum number of errors that are allowed before the task stops being scheduled.

Type: String

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

Pattern: ^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$

Required: No

Name

The new task name to specify.

Type: String

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

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

Required: No

Priority

The new task priority to specify. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.

Type: Integer

Valid Range: Minimum value of 0.

Required: No

Replace

If True, then all fields that are required by the RegisterTaskWithMaintenanceWndow action are also required for this API request. Optional fields that are not specified are set to null.

Type: Boolean

Required: No

ServiceRoleArn

The IAM service role ARN to modify. The system assumes this role during task execution.

Type: String

Required: No

Targets

The targets (either instances or tags) to modify. Instances are specified using Key=instanceids,Values=instanceID_1,instanceID_2. Tags are specified using Key=tag_name,Values=tag_value.

Type: Array of Target objects

Array Members: Minimum number of 0 items. Maximum number of 5 items.

Required: No

TaskArn

The task ARN to modify.

Type: String

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

Required: No

TaskInvocationParameters

The parameters that the task should use during execution. Populate only the fields that match the task type. All other fields should be empty.

Type: MaintenanceWindowTaskInvocationParameters object

Required: No

TaskParameters

The parameters to modify. The map has the following format:

Key: string, between 1 and 255 characters

Value: an array of strings, each string is between 1 and 255 characters

Type: String to MaintenanceWindowTaskParameterValueExpression object map

Key Length Constraints: Minimum length of 1. Maximum length of 255.

Required: No

WindowId

The Maintenance Window ID that contains the task to modify.

Type: String

Length Constraints: Fixed length of 20.

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

Required: Yes

WindowTaskId

The task ID to modify.

Type: String

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

Required: Yes

Response Syntax

{
   "Description": "string",
   "LoggingInfo": { 
      "S3BucketName": "string",
      "S3KeyPrefix": "string",
      "S3Region": "string"
   },
   "MaxConcurrency": "string",
   "MaxErrors": "string",
   "Name": "string",
   "Priority": number,
   "ServiceRoleArn": "string",
   "Targets": [ 
      { 
         "Key": "string",
         "Values": [ "string" ]
      }
   ],
   "TaskArn": "string",
   "TaskInvocationParameters": { 
      "Automation": { 
         "DocumentVersion": "string",
         "Parameters": { 
            "string" : [ "string" ]
         }
      },
      "Lambda": { 
         "ClientContext": "string",
         "Payload": blob,
         "Qualifier": "string"
      },
      "RunCommand": { 
         "Comment": "string",
         "DocumentHash": "string",
         "DocumentHashType": "string",
         "NotificationConfig": { 
            "NotificationArn": "string",
            "NotificationEvents": [ "string" ],
            "NotificationType": "string"
         },
         "OutputS3BucketName": "string",
         "OutputS3KeyPrefix": "string",
         "Parameters": { 
            "string" : [ "string" ]
         },
         "ServiceRoleArn": "string",
         "TimeoutSeconds": number
      },
      "StepFunctions": { 
         "Input": "string",
         "Name": "string"
      }
   },
   "TaskParameters": { 
      "string" : { 
         "Values": [ "string" ]
      }
   },
   "WindowId": "string",
   "WindowTaskId": "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.

Description

The updated task description.

Type: String

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

LoggingInfo

The updated logging information in Amazon S3.

Type: LoggingInfo object

MaxConcurrency

The updated MaxConcurrency value.

Type: String

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

Pattern: ^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$

MaxErrors

The updated MaxErrors value.

Type: String

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

Pattern: ^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$

Name

The updated task name.

Type: String

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

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

Priority

The updated priority value.

Type: Integer

Valid Range: Minimum value of 0.

ServiceRoleArn

The updated service role ARN value.

Type: String

Targets

The updated target values.

Type: Array of Target objects

Array Members: Minimum number of 0 items. Maximum number of 5 items.

TaskArn

The updated task ARN value.

Type: String

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

TaskInvocationParameters

The updated parameter values.

Type: MaintenanceWindowTaskInvocationParameters object

TaskParameters

The updated parameter values.

Type: String to MaintenanceWindowTaskParameterValueExpression object map

Key Length Constraints: Minimum length of 1. Maximum length of 255.

WindowId

The ID of the Maintenance Window that was updated.

Type: String

Length Constraints: Fixed length of 20.

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

WindowTaskId

The task ID of the Maintenance Window that was updated.

Type: String

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

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 (e.g. a Maintenance Window) doesn't exist.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

See Also

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