{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/WindowId",
  "/properties/TaskType"
 ],
 "definitions": {
  "CloudWatchOutputConfig": {
   "additionalProperties": false,
   "properties": {
    "CloudWatchLogGroupName": {
     "type": "string"
    },
    "CloudWatchOutputEnabled": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "LoggingInfo": {
   "additionalProperties": false,
   "properties": {
    "Region": {
     "type": "string"
    },
    "S3Bucket": {
     "format": "AWS::S3::Bucket.Name",
     "type": "string"
    },
    "S3Prefix": {
     "type": "string"
    }
   },
   "required": [
    "S3Bucket",
    "Region"
   ],
   "type": "object"
  },
  "MaintenanceWindowAutomationParameters": {
   "additionalProperties": false,
   "properties": {
    "DocumentVersion": {
     "type": "string"
    },
    "Parameters": {
     "format": "json",
     "type": [
      "object",
      "string"
     ]
    }
   },
   "type": "object"
  },
  "MaintenanceWindowLambdaParameters": {
   "additionalProperties": false,
   "properties": {
    "ClientContext": {
     "type": "string"
    },
    "Payload": {
     "type": "string"
    },
    "Qualifier": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "MaintenanceWindowRunCommandParameters": {
   "additionalProperties": false,
   "properties": {
    "CloudWatchOutputConfig": {
     "$ref": "#/definitions/CloudWatchOutputConfig"
    },
    "Comment": {
     "type": "string"
    },
    "DocumentHash": {
     "type": "string"
    },
    "DocumentHashType": {
     "type": "string"
    },
    "DocumentVersion": {
     "type": "string"
    },
    "NotificationConfig": {
     "$ref": "#/definitions/NotificationConfig"
    },
    "OutputS3BucketName": {
     "type": "string"
    },
    "OutputS3KeyPrefix": {
     "type": "string"
    },
    "Parameters": {
     "format": "json",
     "type": [
      "object",
      "string"
     ]
    },
    "ServiceRoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    },
    "TimeoutSeconds": {
     "type": "integer"
    }
   },
   "type": "object"
  },
  "MaintenanceWindowStepFunctionsParameters": {
   "additionalProperties": false,
   "properties": {
    "Input": {
     "type": "string"
    },
    "Name": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "NotificationConfig": {
   "additionalProperties": false,
   "properties": {
    "NotificationArn": {
     "type": "string"
    },
    "NotificationEvents": {
     "items": {
      "type": "string"
     },
     "type": "array",
     "uniqueItems": false
    },
    "NotificationType": {
     "type": "string"
    }
   },
   "required": [
    "NotificationArn"
   ],
   "type": "object"
  },
  "Target": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 163,
     "minLength": 1,
     "pattern": "^[\\p{L}\\p{Z}\\p{N}_.:/=\\-@]*$|resource-groups:ResourceTypeFilters|resource-groups:Name$",
     "type": "string"
    },
    "Values": {
     "items": {
      "type": "string"
     },
     "maxItems": 50,
     "minItems": 0,
     "type": "array",
     "uniqueItems": false
    }
   },
   "required": [
    "Values",
    "Key"
   ],
   "type": "object"
  },
  "TaskInvocationParameters": {
   "additionalProperties": false,
   "properties": {
    "MaintenanceWindowAutomationParameters": {
     "$ref": "#/definitions/MaintenanceWindowAutomationParameters"
    },
    "MaintenanceWindowLambdaParameters": {
     "$ref": "#/definitions/MaintenanceWindowLambdaParameters"
    },
    "MaintenanceWindowRunCommandParameters": {
     "$ref": "#/definitions/MaintenanceWindowRunCommandParameters"
    },
    "MaintenanceWindowStepFunctionsParameters": {
     "$ref": "#/definitions/MaintenanceWindowStepFunctionsParameters"
    }
   },
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/Id"
 ],
 "properties": {
  "CutoffBehavior": {
   "enum": [
    "CANCEL_TASK",
    "CONTINUE_TASK"
   ],
   "type": "string"
  },
  "Description": {
   "maxLength": 128,
   "minLength": 1,
   "type": "string"
  },
  "Id": {
   "type": "string"
  },
  "LoggingInfo": {
   "$ref": "#/definitions/LoggingInfo"
  },
  "MaxConcurrency": {
   "maxLength": 7,
   "minLength": 1,
   "pattern": "^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$",
   "type": "string"
  },
  "MaxErrors": {
   "maxLength": 7,
   "minLength": 1,
   "pattern": "^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$",
   "type": "string"
  },
  "Name": {
   "maxLength": 128,
   "minLength": 3,
   "pattern": "^[a-zA-Z0-9_\\-.]{3,128}$",
   "type": "string"
  },
  "Priority": {
   "minimum": 0,
   "type": "integer"
  },
  "ServiceRoleArn": {
   "format": "AWS::IAM::Role.Arn",
   "type": "string"
  },
  "Targets": {
   "items": {
    "$ref": "#/definitions/Target"
   },
   "maxItems": 5,
   "minItems": 0,
   "type": "array",
   "uniqueItems": false
  },
  "TaskArn": {
   "maxLength": 1600,
   "minLength": 1,
   "type": "string"
  },
  "TaskInvocationParameters": {
   "$ref": "#/definitions/TaskInvocationParameters"
  },
  "TaskParameters": {
   "format": "json",
   "type": [
    "object",
    "string"
   ]
  },
  "TaskType": {
   "enum": [
    "AUTOMATION",
    "LAMBDA",
    "RUN_COMMAND",
    "STEP_FUNCTIONS"
   ],
   "type": "string"
  },
  "WindowId": {
   "maxLength": 20,
   "minLength": 20,
   "pattern": "^mw-[0-9a-f]{17}$",
   "type": "string"
  }
 },
 "readOnlyProperties": [
  "/properties/Id"
 ],
 "required": [
  "WindowId",
  "Priority",
  "TaskType",
  "TaskArn"
 ],
 "typeName": "AWS::SSM::MaintenanceWindowTask"
}
