{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-emr/json-schema/amazon-emr-modify-instance-fleet-input-schema.json",
  "title": "ModifyInstanceFleetInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-emr-instance-fleet-api-openapi.yml#/components/schemas/ModifyInstanceFleetInput",
  "type": "object",
  "properties": {
    "ClusterId": {
      "type": "string",
      "description": "The unique identifier of the cluster."
    },
    "InstanceFleet": {
      "$ref": "#/$defs/InstanceFleetModifyConfig"
    }
  },
  "required": [
    "ClusterId",
    "InstanceFleet"
  ],
  "$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."
        }
      }
    },
    "EbsBlockDeviceConfig": {
      "type": "object",
      "properties": {
        "VolumeSpecification": {
          "$ref": "#/$defs/VolumeSpecification"
        },
        "VolumesPerInstance": {
          "type": "integer",
          "description": "Number of EBS volumes with a specific volume configuration that are associated with every instance in the instance group"
        }
      },
      "required": [
        "VolumeSpecification"
      ]
    },
    "EbsConfiguration": {
      "type": "object",
      "properties": {
        "EbsBlockDeviceConfigs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EbsBlockDeviceConfig"
          },
          "description": "An array of Amazon EBS volume specifications attached to a cluster instance."
        },
        "EbsOptimized": {
          "type": "boolean",
          "description": "Indicates whether an Amazon EBS volume is EBS-optimized. The default is false. You should explicitly set this value to true to enable the Amazon EBS-optimized setting for an EC2 instance."
        }
      }
    },
    "InstanceFleetModifyConfig": {
      "type": "object",
      "properties": {
        "InstanceFleetId": {
          "type": "string",
          "description": "A unique identifier for the instance fleet."
        },
        "TargetOnDemandCapacity": {
          "type": "integer",
          "description": "The target capacity of On-Demand units for the instance fleet. For more information see InstanceFleetConfig$TargetOnDemandCapacity."
        },
        "TargetSpotCapacity": {
          "type": "integer",
          "description": "The target capacity of Spot units for the instance fleet. For more information, see InstanceFleetConfig$TargetSpotCapacity."
        },
        "ResizeSpecifications": {
          "$ref": "#/$defs/InstanceFleetResizingSpecifications"
        },
        "InstanceTypeConfigs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InstanceTypeConfig"
          },
          "description": "An array of InstanceTypeConfig objects that specify how Amazon EMR provisions Amazon EC2 instances when it fulfills On-Demand and Spot capacities. For more information, see InstanceTypeConfig."
        },
        "Context": {
          "type": "string",
          "description": "Reserved."
        }
      },
      "required": [
        "InstanceFleetId"
      ]
    },
    "InstanceFleetResizingSpecifications": {
      "type": "object",
      "properties": {
        "SpotResizeSpecification": {
          "$ref": "#/$defs/SpotResizingSpecification"
        },
        "OnDemandResizeSpecification": {
          "$ref": "#/$defs/OnDemandResizingSpecification"
        }
      }
    },
    "InstanceTypeConfig": {
      "type": "object",
      "properties": {
        "InstanceType": {
          "type": "string",
          "description": "An Amazon EC2 instance type, such as m3.xlarge."
        },
        "WeightedCapacity": {
          "type": "integer",
          "description": "The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig. This value is 1 for a master instance fleet, and must be 1 or greater for core and task instance fleets. Defaults to 1 if not specified."
        },
        "BidPrice": {
          "type": "string",
          "description": "The bid price for each Amazon EC2 Spot Instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%."
        },
        "BidPriceAsPercentageOfOnDemandPrice": {
          "type": "number",
          "description": "The bid price, as a percentage of On-Demand price, for each Amazon EC2 Spot Instance as defined by InstanceType. Expressed as a number (for example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%."
        },
        "EbsConfiguration": {
          "$ref": "#/$defs/EbsConfiguration"
        },
        "Configurations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Configuration"
          },
          "description": "A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster."
        },
        "CustomAmiId": {
          "type": "string",
          "description": "The custom AMI ID to use for the instance type."
        },
        "Priority": {
          "type": "number",
          "description": "The priority at which Amazon EMR launches the Amazon EC2 instances with this instance type. Priority starts at 0, which is the highest priority. Amazon EMR considers the highest priority first."
        }
      },
      "required": [
        "InstanceType"
      ]
    },
    "OnDemandCapacityReservationOptions": {
      "type": "object",
      "properties": {
        "UsageStrategy": {
          "type": "string",
          "enum": [
            "use-capacity-reservations-first"
          ],
          "description": "Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity. If you specify use-capacity-reservations-first, the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy (lowest-price) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy (lowest-price). If you do not specify a "
        },
        "CapacityReservationPreference": {
          "type": "string",
          "enum": [
            "open",
            "none"
          ],
          "description": "Indicates the instance's Capacity Reservation preferences. Possible preferences include: open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone). none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance."
        },
        "CapacityReservationResourceGroupArn": {
          "type": "string",
          "description": "The ARN of the Capacity Reservation resource group in which to run the instance."
        }
      }
    },
    "OnDemandResizingSpecification": {
      "type": "object",
      "properties": {
        "TimeoutDurationMinutes": {
          "type": "integer",
          "description": "On-Demand resize timeout in minutes. If On-Demand Instances are not provisioned within this time, the resize workflow stops. The minimum value is 5 minutes, and the maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation."
        },
        "AllocationStrategy": {
          "type": "string",
          "enum": [
            "lowest-price",
            "prioritized"
          ],
          "description": "Specifies the allocation strategy to use to launch On-Demand instances during a resize. The default is lowest-price."
        },
        "CapacityReservationOptions": {
          "$ref": "#/$defs/OnDemandCapacityReservationOptions"
        }
      }
    },
    "SpotResizingSpecification": {
      "type": "object",
      "properties": {
        "TimeoutDurationMinutes": {
          "type": "integer",
          "description": "Spot resize timeout in minutes. If Spot Instances are not provisioned within this time, the resize workflow will stop provisioning of Spot instances. Minimum value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation."
        },
        "AllocationStrategy": {
          "type": "string",
          "enum": [
            "capacity-optimized",
            "price-capacity-optimized",
            "lowest-price",
            "diversified",
            "capacity-optimized-prioritized"
          ],
          "description": "Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher, the default is price-capacity-optimized. If you run Amazon EMR releases 6.8.0 or lower, the default is capacity-optimized."
        }
      }
    },
    "VolumeSpecification": {
      "type": "object",
      "properties": {
        "VolumeType": {
          "type": "string",
          "description": "The volume type. Volume types supported are gp3, gp2, io1, st1, sc1, and standard."
        },
        "Iops": {
          "type": "integer",
          "description": "The number of I/O operations per second (IOPS) that the volume supports."
        },
        "SizeInGB": {
          "type": "integer",
          "description": "The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10."
        },
        "Throughput": {
          "type": "integer",
          "description": "The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes."
        }
      },
      "required": [
        "VolumeType",
        "SizeInGB"
      ]
    }
  }
}