# InstanceFleetConfigProperty

The configuration that defines an instance fleet.

- Source: [`aws-stepfunctions-tasks/lib/emr/emr-create-cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/emr/emr-create-cluster.ts#L953)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';

declare const configurationProperty_: stepfunctions_tasks.EmrCreateCluster.ConfigurationProperty;
declare const size: cdk.Size;
const instanceFleetConfigProperty: stepfunctions_tasks.EmrCreateCluster.InstanceFleetConfigProperty = {
  instanceFleetType: stepfunctions_tasks.EmrCreateCluster.InstanceRoleType.MASTER,

  // the properties below are optional
  instanceTypeConfigs: [{
    instanceType: 'instanceType',

    // the properties below are optional
    bidPrice: 'bidPrice',
    bidPriceAsPercentageOfOnDemandPrice: 123,
    configurations: [{
      classification: 'classification',
      configurations: [configurationProperty_],
      properties: {
        propertiesKey: 'properties',
      },
    }],
    ebsConfiguration: {
      ebsBlockDeviceConfigs: [{
        volumeSpecification: {
          volumeSize: size,
          volumeType: stepfunctions_tasks.EmrCreateCluster.EbsBlockDeviceVolumeType.GP3,

          // the properties below are optional
          iops: 123,
        },

        // the properties below are optional
        volumesPerInstance: 123,
      }],
      ebsOptimized: false,
    },
    priority: 123,
    weightedCapacity: 123,
  }],
  launchSpecifications: {
    onDemandSpecification: {
      allocationStrategy: stepfunctions_tasks.EmrCreateCluster.OnDemandAllocationStrategy.LOWEST_PRICE,
    },
    spotSpecification: {
      timeoutAction: stepfunctions_tasks.EmrCreateCluster.SpotTimeoutAction.SWITCH_TO_ON_DEMAND,

      // the properties below are optional
      allocationStrategy: stepfunctions_tasks.EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED,
      blockDurationMinutes: 123,
      timeout: cdk.Duration.minutes(30),
      timeoutDurationMinutes: 123,
    },
  },
  name: 'name',
  targetOnDemandCapacity: 123,
  targetSpotCapacity: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_stepfunctions_tasks as stepfunctions_tasks

# configuration_property_: stepfunctions_tasks.EmrCreateCluster.ConfigurationProperty
# size: cdk.Size

instance_fleet_config_property = stepfunctions_tasks.EmrCreateCluster.InstanceFleetConfigProperty(
    instance_fleet_type=stepfunctions_tasks.EmrCreateCluster.InstanceRoleType.MASTER,

    # the properties below are optional
    instance_type_configs=[stepfunctions_tasks.EmrCreateCluster.InstanceTypeConfigProperty(
        instance_type="instanceType",

        # the properties below are optional
        bid_price="bidPrice",
        bid_price_as_percentage_of_on_demand_price=123,
        configurations=[stepfunctions_tasks.EmrCreateCluster.ConfigurationProperty(
            classification="classification",
            configurations=[configuration_property_],
            properties={
                "properties_key": "properties"
            }
        )],
        ebs_configuration=stepfunctions_tasks.EmrCreateCluster.EbsConfigurationProperty(
            ebs_block_device_configs=[stepfunctions_tasks.EmrCreateCluster.EbsBlockDeviceConfigProperty(
                volume_specification=stepfunctions_tasks.EmrCreateCluster.VolumeSpecificationProperty(
                    volume_size=size,
                    volume_type=stepfunctions_tasks.EmrCreateCluster.EbsBlockDeviceVolumeType.GP3,

                    # the properties below are optional
                    iops=123
                ),

                # the properties below are optional
                volumes_per_instance=123
            )],
            ebs_optimized=False
        ),
        priority=123,
        weighted_capacity=123
    )],
    launch_specifications=stepfunctions_tasks.EmrCreateCluster.InstanceFleetProvisioningSpecificationsProperty(
        on_demand_specification=stepfunctions_tasks.EmrCreateCluster.OnDemandProvisioningSpecificationProperty(
            allocation_strategy=stepfunctions_tasks.EmrCreateCluster.OnDemandAllocationStrategy.LOWEST_PRICE
        ),
        spot_specification=stepfunctions_tasks.EmrCreateCluster.SpotProvisioningSpecificationProperty(
            timeout_action=stepfunctions_tasks.EmrCreateCluster.SpotTimeoutAction.SWITCH_TO_ON_DEMAND,

            # the properties below are optional
            allocation_strategy=stepfunctions_tasks.EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED,
            block_duration_minutes=123,
            timeout=cdk.Duration.minutes(30),
            timeout_duration_minutes=123
        )
    ),
    name="name",
    target_on_demand_capacity=123,
    target_spot_capacity=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.stepfunctions.tasks.*;

ConfigurationProperty configurationProperty_;
Size size;

InstanceFleetConfigProperty instanceFleetConfigProperty = InstanceFleetConfigProperty.builder()
        .instanceFleetType(EmrCreateCluster.getInstanceRoleType().MASTER)

        // the properties below are optional
        .instanceTypeConfigs(List.of(InstanceTypeConfigProperty.builder()
                .instanceType("instanceType")

                // the properties below are optional
                .bidPrice("bidPrice")
                .bidPriceAsPercentageOfOnDemandPrice(123)
                .configurations(List.of(ConfigurationProperty.builder()
                        .classification("classification")
                        .configurations(List.of(configurationProperty_))
                        .properties(Map.of(
                                "propertiesKey", "properties"))
                        .build()))
                .ebsConfiguration(EbsConfigurationProperty.builder()
                        .ebsBlockDeviceConfigs(List.of(EbsBlockDeviceConfigProperty.builder()
                                .volumeSpecification(VolumeSpecificationProperty.builder()
                                        .volumeSize(size)
                                        .volumeType(EmrCreateCluster.getEbsBlockDeviceVolumeType().GP3)

                                        // the properties below are optional
                                        .iops(123)
                                        .build())

                                // the properties below are optional
                                .volumesPerInstance(123)
                                .build()))
                        .ebsOptimized(false)
                        .build())
                .priority(123)
                .weightedCapacity(123)
                .build()))
        .launchSpecifications(InstanceFleetProvisioningSpecificationsProperty.builder()
                .onDemandSpecification(OnDemandProvisioningSpecificationProperty.builder()
                        .allocationStrategy(EmrCreateCluster.getOnDemandAllocationStrategy().LOWEST_PRICE)
                        .build())
                .spotSpecification(SpotProvisioningSpecificationProperty.builder()
                        .timeoutAction(EmrCreateCluster.getSpotTimeoutAction().SWITCH_TO_ON_DEMAND)

                        // the properties below are optional
                        .allocationStrategy(EmrCreateCluster.getSpotAllocationStrategy().CAPACITY_OPTIMIZED)
                        .blockDurationMinutes(123)
                        .timeout(Duration.minutes(30))
                        .timeoutDurationMinutes(123)
                        .build())
                .build())
        .name("name")
        .targetOnDemandCapacity(123)
        .targetSpotCapacity(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.StepFunctions.Tasks;

ConfigurationProperty configurationProperty_;
Size size;

var instanceFleetConfigProperty = new InstanceFleetConfigProperty {
    InstanceFleetType = EmrCreateCluster.InstanceRoleType.MASTER,

    // the properties below are optional
    InstanceTypeConfigs = new [] { new InstanceTypeConfigProperty {
        InstanceType = "instanceType",

        // the properties below are optional
        BidPrice = "bidPrice",
        BidPriceAsPercentageOfOnDemandPrice = 123,
        Configurations = new [] { new ConfigurationProperty {
            Classification = "classification",
            Configurations = new [] { configurationProperty_ },
            Properties = new Dictionary<string, string> {
                { "propertiesKey", "properties" }
            }
        } },
        EbsConfiguration = new EbsConfigurationProperty {
            EbsBlockDeviceConfigs = new [] { new EbsBlockDeviceConfigProperty {
                VolumeSpecification = new VolumeSpecificationProperty {
                    VolumeSize = size,
                    VolumeType = EmrCreateCluster.EbsBlockDeviceVolumeType.GP3,

                    // the properties below are optional
                    Iops = 123
                },

                // the properties below are optional
                VolumesPerInstance = 123
            } },
            EbsOptimized = false
        },
        Priority = 123,
        WeightedCapacity = 123
    } },
    LaunchSpecifications = new InstanceFleetProvisioningSpecificationsProperty {
        OnDemandSpecification = new OnDemandProvisioningSpecificationProperty {
            AllocationStrategy = EmrCreateCluster.OnDemandAllocationStrategy.LOWEST_PRICE
        },
        SpotSpecification = new SpotProvisioningSpecificationProperty {
            TimeoutAction = EmrCreateCluster.SpotTimeoutAction.SWITCH_TO_ON_DEMAND,

            // the properties below are optional
            AllocationStrategy = EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED,
            BlockDurationMinutes = 123,
            Timeout = Duration.Minutes(30),
            TimeoutDurationMinutes = 123
        }
    },
    Name = "name",
    TargetOnDemandCapacity = 123,
    TargetSpotCapacity = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var configurationProperty_ ConfigurationProperty
var size Size

instanceFleetConfigProperty := &InstanceFleetConfigProperty{
	InstanceFleetType: awscdk.Aws_stepfunctions_tasks.EmrCreateCluster.InstanceRoleType_MASTER,

	// the properties below are optional
	InstanceTypeConfigs: []InstanceTypeConfigProperty{
		&InstanceTypeConfigProperty{
			InstanceType: jsii.String("instanceType"),

			// the properties below are optional
			BidPrice: jsii.String("bidPrice"),
			BidPriceAsPercentageOfOnDemandPrice: jsii.Number(123),
			Configurations: []ConfigurationProperty{
				&ConfigurationProperty{
					Classification: jsii.String("classification"),
					Configurations: []ConfigurationProperty{
						configurationProperty_,
					},
					Properties: map[string]*string{
						"propertiesKey": jsii.String("properties"),
					},
				},
			},
			EbsConfiguration: &EbsConfigurationProperty{
				EbsBlockDeviceConfigs: []EbsBlockDeviceConfigProperty{
					&EbsBlockDeviceConfigProperty{
						VolumeSpecification: &VolumeSpecificationProperty{
							VolumeSize: size,
							VolumeType: awscdk.*Aws_stepfunctions_tasks.EmrCreateCluster.EbsBlockDeviceVolumeType_GP3,

							// the properties below are optional
							Iops: jsii.Number(123),
						},

						// the properties below are optional
						VolumesPerInstance: jsii.Number(123),
					},
				},
				EbsOptimized: jsii.Boolean(false),
			},
			Priority: jsii.Number(123),
			WeightedCapacity: jsii.Number(123),
		},
	},
	LaunchSpecifications: &InstanceFleetProvisioningSpecificationsProperty{
		OnDemandSpecification: &OnDemandProvisioningSpecificationProperty{
			AllocationStrategy: awscdk.*Aws_stepfunctions_tasks.EmrCreateCluster.OnDemandAllocationStrategy_LOWEST_PRICE,
		},
		SpotSpecification: &SpotProvisioningSpecificationProperty{
			TimeoutAction: awscdk.*Aws_stepfunctions_tasks.EmrCreateCluster.SpotTimeoutAction_SWITCH_TO_ON_DEMAND,

			// the properties below are optional
			AllocationStrategy: awscdk.*Aws_stepfunctions_tasks.EmrCreateCluster.SpotAllocationStrategy_CAPACITY_OPTIMIZED,
			BlockDurationMinutes: jsii.Number(123),
			Timeout: cdk.Duration_Minutes(jsii.Number(30)),
			TimeoutDurationMinutes: jsii.Number(123),
		},
	},
	Name: jsii.String("name"),
	TargetOnDemandCapacity: jsii.Number(123),
	TargetSpotCapacity: jsii.Number(123),
}
```

## Properties

- `instanceFleetType`: [EmrCreateCluster.InstanceRoleType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster.InstanceRoleType.html) (required) — The node type that the instance fleet hosts.

  Valid values are MASTER,CORE,and TASK.

- `instanceTypeConfigs`: [EmrCreateCluster.InstanceTypeConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster.InstanceTypeConfigProperty.html)[] — The instance type configurations that define the EC2 instances in the instance fleet.

  **Default:** No instanceTpeConfigs

- `launchSpecifications`: [EmrCreateCluster.InstanceFleetProvisioningSpecificationsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EmrCreateCluster.InstanceFleetProvisioningSpecificationsProperty.html) — The launch specification for the instance fleet.

  **Default:** No launchSpecifications

- `name`: string — The friendly name of the instance fleet.

  **Default:** No name

- `targetOnDemandCapacity`: number — The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision.

  **Default:** No targetOnDemandCapacity

  If not specified or set to 0, only Spot Instances are provisioned for the instance fleet using `targetSpotCapacity`.

  At least one of `targetSpotCapacity` and `targetOnDemandCapacity` should be greater than 0.
  For a master instance fleet, only one of `targetSpotCapacity` and `targetOnDemandCapacity` can be specified, and its value
  must be 1.

- `targetSpotCapacity`: number — The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision.

  **Default:** No targetSpotCapacity

  If not specified or set to 0, only On-Demand Instances are provisioned for the instance fleet using `targetOnDemandCapacity`.

  At least one of `targetSpotCapacity` and `targetOnDemandCapacity` should be greater than 0.
  For a master instance fleet, only one of `targetSpotCapacity` and `targetOnDemandCapacity` can be specified, and its value
  must be 1.
