title: AWS Instance Fleets with multiple ec2 types
body: <p>I am getting ready to move my team to AWS instance fleets. Thus far in testing, it's been great; it has really helped with capacity issues via instance diversification.</p>
  <p>However, I expected AWS would choose a mix of instances based on the types I supply to the instance fleet template. For example, I target 15 core nodes as either i3.2xlarge or r5d.2xlarge in the template. So, I would expect my fleet to include some mix of i3.2xlarge and r5d.2xlarge instances. Instead, my fleet is exclusively supplied with r5d.2xlarge machines.</p>
  <p>Perhaps this behavior is due to default allocation strategies, and that there is truly more supply of r5d.2xlarge than i3.2xlarge, which is why no i3.2xlarge machines were used.</p>
  <p>But my question is: for a core node within an instance fleet, can that core node include different types of instances?</p>
  <p>EDIT:</p>
  <p>I am using python and boto3 via run_job_flow() to create the cluster. I am using the templates described here in <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/emr.html#EMR.Client.run_job_flow" rel="nofollow noreferrer">boto3 docs</a>.</p>
  <p>When I run the below, all of my core instances are of the same instance type. I tried setting the <code>AllocationStrategy</code> to <code>diversified</code>, but received an error unknown parameter error. After reading the boto3 docs, it sounds like that isn't supported.</p>
  <p>So how would I adjust this template to create different instance types in the same core node in the same cluster?</p>
  <p>The core node dict I'm submitting in the <code>InstanceFleets</code> list looks like this (keep in mind some of the key values are variables):</p>
  <pre><code>'Name': 'Core Node',
  'InstanceFleetType': 'CORE',
  'InstanceTypeConfigs': [
      { 
          'EbsConfiguration': { 
              'EbsBlockDeviceConfigs': [ 
                  { 
                      'VolumeSpecification': {
                          'SizeInGB': core_ebs_volume_gb_size,
                          'VolumeType': core_ebs_volume_type
                      },
                      'VolumesPerInstance': core_ebs_volumes
                  }
              ],
              'EbsOptimized': True
          },
          'InstanceType': 'i3.2xlarge',
          'WeightedCapacity': 1
      },
      { 
          'EbsConfiguration': { 
              'EbsBlockDeviceConfigs': [ 
                  { 
                      'VolumeSpecification': {
                          'SizeInGB': core_ebs_volume_gb_size,
                          'VolumeType': core_ebs_volume_type
                      },
                      'VolumesPerInstance': core_ebs_volumes
                  }
              ],
              'EbsOptimized': True
          },
          'InstanceType': 'r5d.2xlarge',
          'WeightedCapacity': 1
      },
      { 
          'EbsConfiguration': { 
              'EbsBlockDeviceConfigs': [ 
                  { 
                      'VolumeSpecification': {
                          'SizeInGB': core_ebs_volume_gb_size,
                          'VolumeType': core_ebs_volume_type
                      },
                      'VolumesPerInstance': core_ebs_volumes
                  }
              ],
              'EbsOptimized': True
          },
          'InstanceType': 'c5d.2xlarge',
          'WeightedCapacity': 1
      },
  ],
  'TargetOnDemandCapacity': 3,
  'LaunchSpecifications': {
      'SpotSpecification': {
          'TimeoutDurationMinutes': 60,
          'TimeoutAction': 'SWITCH_TO_ON_DEMAND',
          'AllocationStrategy': 'capacity-optimized'
      }
  }
  </code></pre>