{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-emr/json-schema/amazon-emr-add-instance-fleet-input-schema.json",
  "title": "AddInstanceFleetInput",
  "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/AddInstanceFleetInput",
  "type": "object",
  "properties": {
    "ClusterId": {
      "type": "string",
      "description": "The unique identifier of the cluster."
    },
    "InstanceFleet": {
      "$ref": "#/$defs/InstanceFleetConfig"
    }
  },
  "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."
        }
      }
    },
    "InstanceFleetConfig": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The friendly name of the instance fleet."
        },
        "InstanceFleetType": {
          "type": "string",
          "enum": [
            "MASTER",
            "CORE",
            "TASK"
          ],
          "description": "The node type that the instance fleet hosts. Valid values are MASTER, CORE, and TASK."
        },
        "TargetOnDemandCapacity": {
          "type": "integer",
          "description": "The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand Instances to provision. When the instance fleet launches, Amazon EMR tries to provision On-Demand Instances as specified by InstanceTypeConfig. Each instance configuration has a specified WeightedCapacity. When an On-Demand Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon"
        },
        "TargetSpotCapacity": {
          "type": "integer",
          "description": "The target capacity of Spot units for the instance fleet, which determines how many Spot Instances to provision. When the instance fleet launches, Amazon EMR tries to provision Spot Instances as specified by InstanceTypeConfig. Each instance configuration has a specified WeightedCapacity. When a Spot Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provisi"
        },
        "InstanceTypeConfigs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InstanceTypeConfig"
          },
          "description": "The instance type configurations that define the Amazon EC2 instances in the instance fleet."
        },
        "LaunchSpecifications": {
          "$ref": "#/$defs/InstanceFleetProvisioningSpecifications"
        },
        "ResizeSpecifications": {
          "$ref": "#/$defs/InstanceFleetResizingSpecifications"
        },
        "Context": {
          "type": "string",
          "description": "Reserved."
        }
      },
      "required": [
        "InstanceFleetType"
      ]
    },
    "InstanceFleetProvisioningSpecifications": {
      "type": "object",
      "properties": {
        "SpotSpecification": {
          "$ref": "#/$defs/SpotProvisioningSpecification"
        },
        "OnDemandSpecification": {
          "$ref": "#/$defs/OnDemandProvisioningSpecification"
        }
      }
    },
    "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."
        }
      }
    },
    "OnDemandProvisioningSpecification": {
      "type": "object",
      "properties": {
        "AllocationStrategy": {
          "type": "string",
          "enum": [
            "lowest-price",
            "prioritized"
          ],
          "description": "Specifies the strategy to use in launching On-Demand instance fleets. Available options are lowest-price and prioritized. lowest-price specifies to launch the instances with the lowest price first, and prioritized specifies that Amazon EMR should launch the instances with the highest priority first. The default is lowest-price."
        },
        "CapacityReservationOptions": {
          "$ref": "#/$defs/OnDemandCapacityReservationOptions"
        }
      },
      "required": [
        "AllocationStrategy"
      ]
    },
    "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"
        }
      }
    },
    "SpotProvisioningSpecification": {
      "type": "object",
      "properties": {
        "TimeoutDurationMinutes": {
          "type": "integer",
          "description": "The Spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created."
        },
        "TimeoutAction": {
          "type": "string",
          "enum": [
            "SWITCH_TO_ON_DEMAND",
            "TERMINATE_CLUSTER"
          ],
          "description": "The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND. SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity."
        },
        "BlockDurationMinutes": {
          "type": "integer",
          "description": "The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates. Spot Instances with a defined duration (also kno"
        },
        "AllocationStrategy": {
          "type": "string",
          "enum": [
            "capacity-optimized",
            "price-capacity-optimized",
            "lowest-price",
            "diversified",
            "capacity-optimized-prioritized"
          ],
          "description": "Specifies one of the following strategies to launch Spot Instance fleets: capacity-optimized, price-capacity-optimized, lowest-price, or diversified, and capacity-optimized-prioritized. For more information on the provisioning strategies, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide for Linux Instances. When you launch a Spot Instance fleet with the old console, it automatically launches with the capacity-optimized strategy. You can't change the allocation strategy from the old console."
        }
      },
      "required": [
        "TimeoutDurationMinutes",
        "TimeoutAction"
      ]
    },
    "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"
      ]
    }
  }
}