{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-systems-manager/json-schema/amazon-systems-manager-get-maintenance-window-task-result-schema.json",
  "title": "GetMaintenanceWindowTaskResult",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-systems-manager-maintenance-window-task-api-openapi.yml#/components/schemas/GetMaintenanceWindowTaskResult",
  "type": "object",
  "properties": {
    "WindowId": {
      "type": "string",
      "description": "The retrieved maintenance window ID."
    },
    "WindowTaskId": {
      "type": "string",
      "description": "The retrieved maintenance window task ID."
    },
    "Targets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Target"
      },
      "description": "The targets where the task should run."
    },
    "TaskArn": {
      "type": "string",
      "description": "The resource that the task used during execution. For RUN_COMMAND and AUTOMATION task types, the value of TaskArn is the SSM document name/ARN. For LAMBDA tasks, the value is the function name/ARN. For STEP_FUNCTIONS tasks, the value is the state machine ARN."
    },
    "ServiceRoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run RegisterTaskWithMaintenanceWindow. However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permis"
    },
    "TaskType": {
      "type": "string",
      "enum": [
        "RUN_COMMAND",
        "AUTOMATION",
        "STEP_FUNCTIONS",
        "LAMBDA"
      ],
      "description": "The type of task to run."
    },
    "TaskParameters": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/MaintenanceWindowTaskParameterValueExpression"
      },
      "description": "The parameters to pass to the task when it runs. TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters."
    },
    "TaskInvocationParameters": {
      "$ref": "#/$defs/MaintenanceWindowTaskInvocationParameters"
    },
    "Priority": {
      "type": "integer",
      "description": "The priority of the task when it runs. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel."
    },
    "MaxConcurrency": {
      "type": "string",
      "description": "The maximum number of targets allowed to run this task in parallel. For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1, which may be reported in the response to this command. This value doesn't affect the running of your task and can be ignored."
    },
    "MaxErrors": {
      "type": "string",
      "description": "The maximum number of errors allowed before the task stops being scheduled. For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1, which may be reported in the response to this command. This value doesn't affect the running of your task and can be ignored."
    },
    "LoggingInfo": {
      "$ref": "#/$defs/LoggingInfo"
    },
    "Name": {
      "type": "string",
      "description": "The retrieved task name."
    },
    "Description": {
      "type": "string",
      "description": "The retrieved task description."
    },
    "CutoffBehavior": {
      "type": "string",
      "enum": [
        "CONTINUE_TASK",
        "CANCEL_TASK"
      ],
      "description": "The action to take on tasks when the maintenance window cutoff time is reached. CONTINUE_TASK means that tasks continue to run. For Automation, Lambda, Step Functions tasks, CANCEL_TASK means that currently running task invocations continue, but no new task invocations are started. For Run Command tasks, CANCEL_TASK means the system attempts to stop the task by sending a CancelCommand operation."
    },
    "AlarmConfiguration": {
      "$ref": "#/$defs/AlarmConfiguration"
    }
  },
  "$defs": {
    "Alarm": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of your CloudWatch alarm."
        }
      },
      "required": [
        "Name"
      ]
    },
    "AlarmConfiguration": {
      "type": "object",
      "properties": {
        "IgnorePollAlarmFailure": {
          "type": "boolean",
          "description": "When this value is true, your automation or command continues to run in cases where we can’t retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false."
        },
        "Alarms": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Alarm"
          },
          "description": "The name of the CloudWatch alarm specified in the configuration."
        }
      },
      "required": [
        "Alarms"
      ]
    },
    "CloudWatchOutputConfig": {
      "type": "object",
      "properties": {
        "CloudWatchLogGroupName": {
          "type": "string",
          "description": "The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format: aws/ssm/SystemsManagerDocumentName"
        },
        "CloudWatchOutputEnabled": {
          "type": "boolean",
          "description": "Enables Systems Manager to send command output to CloudWatch Logs."
        }
      }
    },
    "LoggingInfo": {
      "type": "object",
      "properties": {
        "S3BucketName": {
          "type": "string",
          "description": "The name of an S3 bucket where execution logs are stored."
        },
        "S3KeyPrefix": {
          "type": "string",
          "description": "(Optional) The S3 bucket subfolder."
        },
        "S3Region": {
          "type": "string",
          "description": "The Amazon Web Services Region where the S3 bucket is located."
        }
      },
      "required": [
        "S3BucketName",
        "S3Region"
      ]
    },
    "MaintenanceWindowAutomationParameters": {
      "type": "object",
      "properties": {
        "DocumentVersion": {
          "type": "string",
          "description": "The version of an Automation runbook to use during task execution."
        },
        "Parameters": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "The parameters for the AUTOMATION task. For information about specifying and updating task parameters, see RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask. LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters. TaskParameters has been d"
        }
      }
    },
    "MaintenanceWindowLambdaParameters": {
      "type": "object",
      "properties": {
        "ClientContext": {
          "type": "string",
          "description": "Pass client-specific information to the Lambda function that you are invoking. You can then process the client information in your Lambda function as you choose through the context variable."
        },
        "Qualifier": {
          "type": "string",
          "description": "(Optional) Specify an Lambda function version or alias name. If you specify a function version, the operation uses the qualified function Amazon Resource Name (ARN) to invoke a specific Lambda function. If you specify an alias name, the operation uses the alias ARN to invoke the Lambda function version to which the alias points."
        },
        "Payload": {
          "type": "string",
          "format": "byte",
          "description": "JSON to provide to your Lambda function as input."
        }
      }
    },
    "MaintenanceWindowRunCommandParameters": {
      "type": "object",
      "properties": {
        "Comment": {
          "type": "string",
          "description": "Information about the commands to run."
        },
        "CloudWatchOutputConfig": {
          "$ref": "#/$defs/CloudWatchOutputConfig"
        },
        "DocumentHash": {
          "type": "string",
          "description": "The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated."
        },
        "DocumentHashType": {
          "type": "string",
          "enum": [
            "Sha256",
            "Sha1"
          ],
          "description": "SHA-256 or SHA-1. SHA-1 hashes have been deprecated."
        },
        "DocumentVersion": {
          "type": "string",
          "description": "The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example: --document-version \"\\$DEFAULT\" --document-version \"\\$LATEST\" --document-version \"3\""
        },
        "NotificationConfig": {
          "$ref": "#/$defs/NotificationConfig"
        },
        "OutputS3BucketName": {
          "type": "string",
          "description": "The name of the Amazon Simple Storage Service (Amazon S3) bucket."
        },
        "OutputS3KeyPrefix": {
          "type": "string",
          "description": "The S3 bucket subfolder."
        },
        "Parameters": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "The parameters for the RUN_COMMAND task execution."
        },
        "ServiceRoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run RegisterTaskWithMaintenanceWindow. However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permis"
        },
        "TimeoutSeconds": {
          "type": "integer",
          "description": "If this time is reached and the command hasn't already started running, it doesn't run."
        }
      }
    },
    "MaintenanceWindowStepFunctionsParameters": {
      "type": "object",
      "properties": {
        "Input": {
          "type": "string",
          "description": "The inputs for the STEP_FUNCTIONS task."
        },
        "Name": {
          "type": "string",
          "description": "The name of the STEP_FUNCTIONS task."
        }
      }
    },
    "MaintenanceWindowTaskInvocationParameters": {
      "type": "object",
      "properties": {
        "RunCommand": {
          "$ref": "#/$defs/MaintenanceWindowRunCommandParameters"
        },
        "Automation": {
          "$ref": "#/$defs/MaintenanceWindowAutomationParameters"
        },
        "StepFunctions": {
          "$ref": "#/$defs/MaintenanceWindowStepFunctionsParameters"
        },
        "Lambda": {
          "$ref": "#/$defs/MaintenanceWindowLambdaParameters"
        }
      }
    },
    "MaintenanceWindowTaskParameterValueExpression": {
      "type": "object",
      "properties": {
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "This field contains an array of 0 or more strings, each 1 to 255 characters in length."
        }
      }
    },
    "NotificationConfig": {
      "type": "object",
      "properties": {
        "NotificationArn": {
          "type": "string",
          "description": "An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic."
        },
        "NotificationEvents": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "All",
              "InProgress",
              "Success",
              "TimedOut",
              "Cancelled",
              "Failed"
            ]
          },
          "description": "The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide."
        },
        "NotificationType": {
          "type": "string",
          "enum": [
            "Command",
            "Invocation"
          ],
          "description": "The type of notification. Command: Receive notification when the status of a command changes. Invocation: For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes."
        }
      }
    },
    "Target": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "User-defined criteria for sending commands that target managed nodes that meet the criteria."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer. Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50."
        }
      }
    }
  }
}