{
 "additionalIdentifiers": [
  [
   "/properties/ClusterName"
  ]
 ],
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/ClusterName",
  "/properties/VpcConfig",
  "/properties/Orchestrator",
  "/properties/InstanceGroups/*/OverrideVpcConfig",
  "/properties/InstanceGroups/*/ExecutionRole",
  "/properties/InstanceGroups/*/InstanceGroupName",
  "/properties/InstanceGroups/*/InstanceType",
  "/properties/InstanceGroups/*/ThreadsPerCore",
  "/properties/RestrictedInstanceGroups/*/OverrideVpcConfig",
  "/properties/RestrictedInstanceGroups/*/ExecutionRole",
  "/properties/RestrictedInstanceGroups/*/InstanceGroupName",
  "/properties/RestrictedInstanceGroups/*/InstanceType",
  "/properties/RestrictedInstanceGroups/*/ThreadsPerCore"
 ],
 "definitions": {
  "AlarmDetails": {
   "additionalProperties": false,
   "properties": {
    "AlarmName": {
     "maxLength": 256,
     "minLength": 1,
     "pattern": "(?!\\s*$).+",
     "type": "string"
    }
   },
   "required": [
    "AlarmName"
   ],
   "type": "object"
  },
  "AutoRollbackConfiguration": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/AlarmDetails"
   },
   "maxItems": 10,
   "minItems": 1,
   "type": "array"
  },
  "CapacitySizeConfig": {
   "additionalProperties": false,
   "properties": {
    "Type": {
     "pattern": "INSTANCE_COUNT|CAPACITY_PERCENTAGE",
     "type": "string"
    },
    "Value": {
     "minimum": 1,
     "type": "integer"
    }
   },
   "required": [
    "Type",
    "Value"
   ],
   "type": "object"
  },
  "ClusterAutoScalingConfig": {
   "additionalProperties": false,
   "properties": {
    "AutoScalerType": {
     "default": "Karpenter",
     "enum": [
      "Karpenter"
     ],
     "type": "string"
    },
    "Mode": {
     "enum": [
      "Enable",
      "Disable"
     ],
     "type": "string"
    }
   },
   "required": [
    "Mode"
   ],
   "type": "object"
  },
  "ClusterCapacityRequirements": {
   "additionalProperties": false,
   "properties": {
    "OnDemand": {
     "$ref": "#/definitions/ClusterOnDemandOptions"
    },
    "Spot": {
     "$ref": "#/definitions/ClusterSpotOptions"
    }
   },
   "type": "object"
  },
  "ClusterEbsVolumeConfig": {
   "additionalProperties": false,
   "properties": {
    "RootVolume": {
     "type": "boolean"
    },
    "VolumeKmsKeyId": {
     "maxLength": 2048,
     "minLength": 0,
     "pattern": "^[a-zA-Z0-9:/_-]*$",
     "type": "string"
    },
    "VolumeSizeInGB": {
     "maximum": 16384,
     "minimum": 1,
     "type": "integer"
    }
   },
   "type": "object"
  },
  "ClusterInstanceGroup": {
   "additionalProperties": false,
   "properties": {
    "CapacityRequirements": {
     "$ref": "#/definitions/ClusterCapacityRequirements"
    },
    "CurrentCount": {
     "minimum": 0,
     "type": "integer"
    },
    "ExecutionRole": {
     "$ref": "#/definitions/ExecutionRole"
    },
    "ImageId": {
     "$ref": "#/definitions/ImageId"
    },
    "InstanceCount": {
     "maximum": 6758,
     "minimum": 0,
     "type": "integer"
    },
    "InstanceGroupName": {
     "$ref": "#/definitions/InstanceGroupName"
    },
    "InstanceStorageConfigs": {
     "$ref": "#/definitions/ClusterInstanceStorageConfigs"
    },
    "InstanceType": {
     "$ref": "#/definitions/InstanceType"
    },
    "KubernetesConfig": {
     "$ref": "#/definitions/ClusterKubernetesConfig"
    },
    "LifeCycleConfig": {
     "$ref": "#/definitions/ClusterLifeCycleConfig"
    },
    "MinInstanceCount": {
     "maximum": 6758,
     "minimum": 0,
     "type": "integer"
    },
    "OnStartDeepHealthChecks": {
     "$ref": "#/definitions/OnStartDeepHealthChecks"
    },
    "OverrideVpcConfig": {
     "$ref": "#/definitions/VpcConfig"
    },
    "ScheduledUpdateConfig": {
     "$ref": "#/definitions/ScheduledUpdateConfig"
    },
    "ThreadsPerCore": {
     "maximum": 2,
     "minimum": 1,
     "type": "integer"
    },
    "TrainingPlanArn": {
     "maxLength": 2048,
     "minLength": 50,
     "pattern": "^arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:training-plan/.*$",
     "type": "string"
    }
   },
   "required": [
    "ExecutionRole",
    "InstanceCount",
    "InstanceGroupName",
    "InstanceType",
    "LifeCycleConfig"
   ],
   "type": "object"
  },
  "ClusterInstanceGroupsList": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/ClusterInstanceGroup"
   },
   "maxItems": 100,
   "minItems": 1,
   "type": "array"
  },
  "ClusterInstanceStorageConfig": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "EbsVolumeConfig": {
       "$ref": "#/definitions/ClusterEbsVolumeConfig"
      }
     },
     "type": "object"
    }
   ],
   "type": "object"
  },
  "ClusterInstanceStorageConfigs": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/ClusterInstanceStorageConfig"
   },
   "maxItems": 1,
   "minItems": 0,
   "type": "array"
  },
  "ClusterKubernetesConfig": {
   "additionalProperties": false,
   "properties": {
    "Labels": {
     "$ref": "#/definitions/ClusterKubernetesLabels"
    },
    "Taints": {
     "$ref": "#/definitions/ClusterKubernetesTaints"
    }
   },
   "type": "object"
  },
  "ClusterKubernetesLabels": {
   "additionalProperties": false,
   "patternProperties": {
    "^.+$": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ClusterKubernetesTaint": {
   "additionalProperties": false,
   "properties": {
    "Effect": {
     "enum": [
      "NoSchedule",
      "PreferNoSchedule",
      "NoExecute"
     ],
     "type": "string"
    },
    "Key": {
     "maxLength": 317,
     "minLength": 1,
     "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?[A-Za-z0-9]([-A-Za-z0-9_.]*[A-Za-z0-9])?$",
     "type": "string"
    },
    "Value": {
     "maxLength": 63,
     "minLength": 1,
     "pattern": "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$",
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Effect"
   ],
   "type": "object"
  },
  "ClusterKubernetesTaints": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/ClusterKubernetesTaint"
   },
   "maxItems": 50,
   "minItems": 0,
   "type": "array"
  },
  "ClusterLifeCycleConfig": {
   "additionalProperties": false,
   "properties": {
    "OnCreate": {
     "maxLength": 128,
     "minLength": 1,
     "pattern": "^[\\S\\s]+$",
     "type": "string"
    },
    "SourceS3Uri": {
     "maxLength": 1024,
     "minLength": 0,
     "pattern": "^(https|s3)://([^/]+)/?(.*)$",
     "type": "string"
    }
   },
   "required": [
    "OnCreate",
    "SourceS3Uri"
   ],
   "type": "object"
  },
  "ClusterOnDemandOptions": {
   "additionalProperties": false,
   "type": "object"
  },
  "ClusterOrchestratorEksConfig": {
   "additionalProperties": false,
   "properties": {
    "ClusterArn": {
     "maxLength": 2048,
     "minLength": 20,
     "pattern": "^arn:aws[a-z\\-]*:eks:[a-z0-9\\-]*:[0-9]{12}:cluster\\/[0-9A-Za-z][A-Za-z0-9\\-_]{0,99}$",
     "type": "string"
    }
   },
   "required": [
    "ClusterArn"
   ],
   "type": "object"
  },
  "ClusterRestrictedInstanceGroup": {
   "additionalProperties": false,
   "properties": {
    "CurrentCount": {
     "minimum": 0,
     "type": "integer"
    },
    "EnvironmentConfig": {
     "$ref": "#/definitions/EnvironmentConfig"
    },
    "ExecutionRole": {
     "$ref": "#/definitions/ExecutionRole"
    },
    "InstanceCount": {
     "maximum": 6758,
     "minimum": 0,
     "type": "integer"
    },
    "InstanceGroupName": {
     "$ref": "#/definitions/InstanceGroupName"
    },
    "InstanceStorageConfigs": {
     "$ref": "#/definitions/ClusterInstanceStorageConfigs"
    },
    "InstanceType": {
     "$ref": "#/definitions/InstanceType"
    },
    "OnStartDeepHealthChecks": {
     "$ref": "#/definitions/OnStartDeepHealthChecks"
    },
    "OverrideVpcConfig": {
     "$ref": "#/definitions/VpcConfig"
    },
    "ThreadsPerCore": {
     "maximum": 2,
     "minimum": 1,
     "type": "integer"
    },
    "TrainingPlanArn": {
     "maxLength": 2048,
     "minLength": 50,
     "pattern": "^arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:training-plan/.*$",
     "type": "string"
    }
   },
   "required": [
    "ExecutionRole",
    "InstanceCount",
    "InstanceGroupName",
    "InstanceType",
    "EnvironmentConfig"
   ],
   "type": "object"
  },
  "ClusterRestrictedInstanceGroupsList": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/ClusterRestrictedInstanceGroup"
   },
   "maxItems": 100,
   "minItems": 1,
   "type": "array"
  },
  "ClusterSpotOptions": {
   "additionalProperties": false,
   "type": "object"
  },
  "DeepHealthCheckType": {
   "enum": [
    "InstanceStress",
    "InstanceConnectivity"
   ],
   "type": "string"
  },
  "DeploymentConfig": {
   "additionalProperties": false,
   "properties": {
    "AutoRollbackConfiguration": {
     "$ref": "#/definitions/AutoRollbackConfiguration"
    },
    "RollingUpdatePolicy": {
     "$ref": "#/definitions/RollingUpdatePolicy"
    },
    "WaitIntervalInSeconds": {
     "maximum": 3600,
     "minimum": 0,
     "type": "integer"
    }
   },
   "type": "object"
  },
  "EnvironmentConfig": {
   "additionalProperties": false,
   "properties": {
    "FSxLustreConfig": {
     "$ref": "#/definitions/FSxLustreConfig"
    }
   },
   "type": "object"
  },
  "ExecutionRole": {
   "maxLength": 2048,
   "minLength": 20,
   "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$",
   "type": "string"
  },
  "FSxLustreConfig": {
   "additionalProperties": false,
   "properties": {
    "PerUnitStorageThroughput": {
     "maximum": 1000,
     "minimum": 125,
     "type": "integer"
    },
    "SizeInGiB": {
     "maximum": 100800,
     "minimum": 1200,
     "type": "integer"
    }
   },
   "required": [
    "SizeInGiB",
    "PerUnitStorageThroughput"
   ],
   "type": "object"
  },
  "ImageId": {
   "format": "AWS::EC2::Image.Id",
   "maxLength": 21,
   "minLength": 7,
   "pattern": "^ami-[0-9a-fA-F]{8,17}|default$",
   "type": "string"
  },
  "InstanceGroupName": {
   "maxLength": 63,
   "minLength": 1,
   "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$",
   "type": "string"
  },
  "InstanceType": {
   "enum": [
    "ml.c5.12xlarge",
    "ml.c5.18xlarge",
    "ml.c5.24xlarge",
    "ml.c5.2xlarge",
    "ml.c5.4xlarge",
    "ml.c5.9xlarge",
    "ml.c5.large",
    "ml.c5.xlarge",
    "ml.c5n.18xlarge",
    "ml.c5n.2xlarge",
    "ml.c5n.4xlarge",
    "ml.c5n.9xlarge",
    "ml.c5n.large",
    "ml.c6i.12xlarge",
    "ml.c6i.16xlarge",
    "ml.c6i.24xlarge",
    "ml.c6i.2xlarge",
    "ml.c6i.32xlarge",
    "ml.c6i.4xlarge",
    "ml.c6i.8xlarge",
    "ml.c6i.large",
    "ml.c6i.xlarge",
    "ml.g5.12xlarge",
    "ml.g5.16xlarge",
    "ml.g5.24xlarge",
    "ml.g5.2xlarge",
    "ml.g5.48xlarge",
    "ml.g5.4xlarge",
    "ml.g5.8xlarge",
    "ml.g5.xlarge",
    "ml.g6.12xlarge",
    "ml.g6.16xlarge",
    "ml.g6.24xlarge",
    "ml.g6.2xlarge",
    "ml.g6.48xlarge",
    "ml.g6.4xlarge",
    "ml.g6.8xlarge",
    "ml.g6.xlarge",
    "ml.g6e.12xlarge",
    "ml.g6e.16xlarge",
    "ml.g6e.24xlarge",
    "ml.g6e.2xlarge",
    "ml.g6e.48xlarge",
    "ml.g6e.4xlarge",
    "ml.g6e.8xlarge",
    "ml.g6e.xlarge",
    "ml.gr6.4xlarge",
    "ml.gr6.8xlarge",
    "ml.i3en.12xlarge",
    "ml.i3en.24xlarge",
    "ml.i3en.2xlarge",
    "ml.i3en.3xlarge",
    "ml.i3en.6xlarge",
    "ml.i3en.large",
    "ml.i3en.xlarge",
    "ml.m5.12xlarge",
    "ml.m5.16xlarge",
    "ml.m5.24xlarge",
    "ml.m5.2xlarge",
    "ml.m5.4xlarge",
    "ml.m5.8xlarge",
    "ml.m5.large",
    "ml.m5.xlarge",
    "ml.m6i.12xlarge",
    "ml.m6i.16xlarge",
    "ml.m6i.24xlarge",
    "ml.m6i.2xlarge",
    "ml.m6i.32xlarge",
    "ml.m6i.4xlarge",
    "ml.m6i.8xlarge",
    "ml.m6i.large",
    "ml.m6i.xlarge",
    "ml.m7i.12xlarge",
    "ml.m7i.16xlarge",
    "ml.m7i.24xlarge",
    "ml.m7i.2xlarge",
    "ml.m7i.48xlarge",
    "ml.m7i.4xlarge",
    "ml.m7i.8xlarge",
    "ml.m7i.large",
    "ml.m7i.xlarge",
    "ml.p4d.24xlarge",
    "ml.p4de.24xlarge",
    "ml.p5.48xlarge",
    "ml.p5.4xlarge",
    "ml.p5e.48xlarge",
    "ml.p5en.48xlarge",
    "ml.p6-b200.48xlarge",
    "ml.p6-b300.48xlarge",
    "ml.p6e-gb200.36xlarge",
    "ml.r6i.12xlarge",
    "ml.r6i.16xlarge",
    "ml.r6i.24xlarge",
    "ml.r6i.2xlarge",
    "ml.r6i.32xlarge",
    "ml.r6i.4xlarge",
    "ml.r6i.8xlarge",
    "ml.r6i.large",
    "ml.r6i.xlarge",
    "ml.r7i.12xlarge",
    "ml.r7i.16xlarge",
    "ml.r7i.24xlarge",
    "ml.r7i.2xlarge",
    "ml.r7i.48xlarge",
    "ml.r7i.4xlarge",
    "ml.r7i.8xlarge",
    "ml.r7i.large",
    "ml.r7i.xlarge",
    "ml.t3.2xlarge",
    "ml.t3.large",
    "ml.t3.medium",
    "ml.t3.xlarge",
    "ml.trn1.32xlarge",
    "ml.trn1n.32xlarge",
    "ml.trn2.3xlarge",
    "ml.trn2.48xlarge"
   ],
   "type": "string"
  },
  "OnStartDeepHealthChecks": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/DeepHealthCheckType"
   },
   "maxItems": 2,
   "minItems": 1,
   "type": "array"
  },
  "Orchestrator": {
   "additionalProperties": false,
   "properties": {
    "Eks": {
     "$ref": "#/definitions/ClusterOrchestratorEksConfig"
    }
   },
   "required": [
    "Eks"
   ],
   "type": "object"
  },
  "RollingUpdatePolicy": {
   "additionalProperties": false,
   "properties": {
    "MaximumBatchSize": {
     "$ref": "#/definitions/CapacitySizeConfig"
    },
    "RollbackMaximumBatchSize": {
     "$ref": "#/definitions/CapacitySizeConfig"
    }
   },
   "required": [
    "MaximumBatchSize"
   ],
   "type": "object"
  },
  "ScheduledUpdateConfig": {
   "additionalProperties": false,
   "properties": {
    "DeploymentConfig": {
     "$ref": "#/definitions/DeploymentConfig"
    },
    "ScheduleExpression": {
     "maxLength": 256,
     "minLength": 1,
     "pattern": "cron\\((?:[0-5][0-9]|[0-9]|) (?:[01][0-9]|2[0-3]|[0-9]) (?:[1-9]|0[1-9]|[12][0-9]|3[01]|\\?) (?:[1-9]|0[1-9]|1[0-2]|\\*|\\*/(?:[1-9]|1[0-2])|) (?:MON|TUE|WED|THU|FRI|SAT|SUN|[1-7]|\\?|L|(?:[1-7]#[1-5])|(?:[1-7]L)) (?:20[2-9][0-9]|\\*|)\\)",
     "type": "string"
    }
   },
   "required": [
    "ScheduleExpression"
   ],
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$",
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$",
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Value"
   ],
   "type": "object"
  },
  "TieredStorageConfig": {
   "additionalProperties": false,
   "properties": {
    "InstanceMemoryAllocationPercentage": {
     "maximum": 100,
     "minimum": 0,
     "type": "integer"
    },
    "Mode": {
     "enum": [
      "Enable",
      "Disable"
     ],
     "type": "string"
    }
   },
   "required": [
    "Mode"
   ],
   "type": "object"
  },
  "VpcConfig": {
   "additionalProperties": false,
   "properties": {
    "SecurityGroupIds": {
     "format": "AWS::EC2::SecurityGroup.Ids",
     "insertionOrder": false,
     "items": {
      "format": "AWS::EC2::SecurityGroup.Id",
      "maxLength": 32,
      "minLength": 0,
      "pattern": "[-0-9a-zA-Z]+",
      "type": "string"
     },
     "maxItems": 5,
     "minItems": 1,
     "type": "array"
    },
    "Subnets": {
     "format": "AWS::EC2::Subnet.Ids",
     "insertionOrder": false,
     "items": {
      "format": "AWS::EC2::Subnet.Id",
      "maxLength": 32,
      "minLength": 0,
      "pattern": "[-0-9a-zA-Z]+",
      "type": "string"
     },
     "maxItems": 16,
     "minItems": 1,
     "type": "array"
    }
   },
   "required": [
    "SecurityGroupIds",
    "Subnets"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/ClusterArn"
 ],
 "properties": {
  "AutoScaling": {
   "$ref": "#/definitions/ClusterAutoScalingConfig"
  },
  "ClusterArn": {
   "maxLength": 256,
   "pattern": "^arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:cluster/[a-z0-9]{12}$",
   "type": "string"
  },
  "ClusterName": {
   "maxLength": 63,
   "minLength": 1,
   "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}$",
   "type": "string"
  },
  "ClusterRole": {
   "maxLength": 2048,
   "minLength": 20,
   "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$",
   "type": "string"
  },
  "ClusterStatus": {
   "enum": [
    "Creating",
    "Deleting",
    "Failed",
    "InService",
    "RollingBack",
    "SystemUpdating",
    "Updating"
   ],
   "type": "string"
  },
  "CreationTime": {
   "type": "string"
  },
  "FailureMessage": {
   "type": "string"
  },
  "InstanceGroups": {
   "$ref": "#/definitions/ClusterInstanceGroupsList"
  },
  "NodeProvisioningMode": {
   "enum": [
    "Continuous"
   ],
   "type": "string"
  },
  "NodeRecovery": {
   "enum": [
    "Automatic",
    "None"
   ],
   "type": "string"
  },
  "Orchestrator": {
   "$ref": "#/definitions/Orchestrator"
  },
  "RestrictedInstanceGroups": {
   "$ref": "#/definitions/ClusterRestrictedInstanceGroupsList"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "maxItems": 50,
   "minItems": 0,
   "type": "array",
   "uniqueItems": true
  },
  "TieredStorageConfig": {
   "$ref": "#/definitions/TieredStorageConfig"
  },
  "VpcConfig": {
   "$ref": "#/definitions/VpcConfig"
  }
 },
 "readOnlyProperties": [
  "/properties/ClusterArn",
  "/properties/CreationTime",
  "/properties/ClusterStatus",
  "/properties/FailureMessage",
  "/properties/InstanceGroups/*/CurrentCount",
  "/properties/RestrictedInstanceGroups/*/CurrentCount"
 ],
 "required": [],
 "tagging": {
  "cloudFormationSystemTags": false,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::SageMaker::Cluster"
}
