{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-emr/json-schema/amazon-emr-modify-instance-groups-input-schema.json",
  "title": "ModifyInstanceGroupsInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-emr-instance-group-api-openapi.yml#/components/schemas/ModifyInstanceGroupsInput",
  "type": "object",
  "properties": {
    "ClusterId": {
      "type": "string",
      "description": "The ID of the cluster to which the instance group belongs."
    },
    "InstanceGroups": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InstanceGroupModifyConfig"
      },
      "description": "Instance groups to change."
    }
  },
  "$defs": {
    "Configuration": {
      "type": "object",
      "properties": {
        "Classification": {
          "type": "string",
          "description": "The classification within a configuration."
        },
        "Configurations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Configuration"
          },
          "description": "A list of additional configurations to apply within a configuration object."
        },
        "Properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A set of properties specified within a configuration classification."
        }
      }
    },
    "InstanceGroupModifyConfig": {
      "type": "object",
      "properties": {
        "InstanceGroupId": {
          "type": "string",
          "description": "Unique ID of the instance group to modify."
        },
        "InstanceCount": {
          "type": "integer",
          "description": "Target size for the instance group."
        },
        "EC2InstanceIdsToTerminate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The Amazon EC2 InstanceIds to terminate. After you terminate the instances, the instance group will not return to its original requested size."
        },
        "ShrinkPolicy": {
          "$ref": "#/$defs/ShrinkPolicy"
        },
        "ReconfigurationType": {
          "type": "string",
          "enum": [
            "OVERWRITE",
            "MERGE"
          ],
          "description": "Type of reconfiguration requested. Valid values are MERGE and OVERWRITE."
        },
        "Configurations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Configuration"
          },
          "description": "A list of new or modified configurations to apply for an instance group."
        }
      },
      "required": [
        "InstanceGroupId"
      ]
    },
    "InstanceResizePolicy": {
      "type": "object",
      "properties": {
        "InstancesToTerminate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Specific list of instances to be terminated when shrinking an instance group."
        },
        "InstancesToProtect": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Specific list of instances to be protected when shrinking an instance group."
        },
        "InstanceTerminationTimeout": {
          "type": "integer",
          "description": "Decommissioning timeout override for the specific list of instances to be terminated."
        }
      }
    },
    "ShrinkPolicy": {
      "type": "object",
      "properties": {
        "DecommissionTimeout": {
          "type": "integer",
          "description": "The desired timeout for decommissioning an instance. Overrides the default YARN decommissioning timeout."
        },
        "InstanceResizePolicy": {
          "$ref": "#/$defs/InstanceResizePolicy"
        }
      }
    }
  }
}