Skip to content
v2.278.0

InstanceFleetProvisioningSpecificationsProperty Struct ​

The launch specification for On-Demand and Spot instances in the fleet, which determines the defined duration and provisioning timeout behavior, and allocation strategy.

The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. On-Demand and Spot instance allocation strategies are available in Amazon EMR releases 5.12.1 and later.

Example ​

ts
new tasks.EmrCreateCluster(this, 'OnDemandSpecification', {
  instances: {
    instanceFleets: [{
      instanceFleetType: tasks.EmrCreateCluster.InstanceRoleType.MASTER,
      launchSpecifications: {
        onDemandSpecification: {
          allocationStrategy: tasks.EmrCreateCluster.OnDemandAllocationStrategy.LOWEST_PRICE,
        },
      },
    }],
  },
  name: 'OnDemandCluster',
  integrationPattern: sfn.IntegrationPattern.RUN_JOB,
});

new tasks.EmrCreateCluster(this, 'SpotSpecification', {
  instances: {
    instanceFleets: [{
      instanceFleetType: tasks.EmrCreateCluster.InstanceRoleType.MASTER,
      launchSpecifications: {
        spotSpecification: {
          allocationStrategy: tasks.EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED,
          timeoutAction: tasks.EmrCreateCluster.SpotTimeoutAction.TERMINATE_CLUSTER,
          timeout: Duration.minutes(5),
        },
      },
    }],
  },
  name: 'SpotCluster',
  integrationPattern: sfn.IntegrationPattern.RUN_JOB,
});
python
tasks.EmrCreateCluster(self, "OnDemandSpecification",
    instances=tasks.EmrCreateCluster.InstancesConfigProperty(
        instance_fleets=[tasks.EmrCreateCluster.InstanceFleetConfigProperty(
            instance_fleet_type=tasks.EmrCreateCluster.InstanceRoleType.MASTER,
            launch_specifications=tasks.EmrCreateCluster.InstanceFleetProvisioningSpecificationsProperty(
                on_demand_specification=tasks.EmrCreateCluster.OnDemandProvisioningSpecificationProperty(
                    allocation_strategy=tasks.EmrCreateCluster.OnDemandAllocationStrategy.LOWEST_PRICE
                )
            )
        )]
    ),
    name="OnDemandCluster",
    integration_pattern=sfn.IntegrationPattern.RUN_JOB
)

tasks.EmrCreateCluster(self, "SpotSpecification",
    instances=tasks.EmrCreateCluster.InstancesConfigProperty(
        instance_fleets=[tasks.EmrCreateCluster.InstanceFleetConfigProperty(
            instance_fleet_type=tasks.EmrCreateCluster.InstanceRoleType.MASTER,
            launch_specifications=tasks.EmrCreateCluster.InstanceFleetProvisioningSpecificationsProperty(
                spot_specification=tasks.EmrCreateCluster.SpotProvisioningSpecificationProperty(
                    allocation_strategy=tasks.EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED,
                    timeout_action=tasks.EmrCreateCluster.SpotTimeoutAction.TERMINATE_CLUSTER,
                    timeout=Duration.minutes(5)
                )
            )
        )]
    ),
    name="SpotCluster",
    integration_pattern=sfn.IntegrationPattern.RUN_JOB
)
java
EmrCreateCluster.Builder.create(this, "OnDemandSpecification")
        .instances(InstancesConfigProperty.builder()
                .instanceFleets(List.of(InstanceFleetConfigProperty.builder()
                        .instanceFleetType(EmrCreateCluster.getInstanceRoleType().MASTER)
                        .launchSpecifications(InstanceFleetProvisioningSpecificationsProperty.builder()
                                .onDemandSpecification(OnDemandProvisioningSpecificationProperty.builder()
                                        .allocationStrategy(EmrCreateCluster.getOnDemandAllocationStrategy().LOWEST_PRICE)
                                        .build())
                                .build())
                        .build()))
                .build())
        .name("OnDemandCluster")
        .integrationPattern(IntegrationPattern.RUN_JOB)
        .build();

EmrCreateCluster.Builder.create(this, "SpotSpecification")
        .instances(InstancesConfigProperty.builder()
                .instanceFleets(List.of(InstanceFleetConfigProperty.builder()
                        .instanceFleetType(EmrCreateCluster.getInstanceRoleType().MASTER)
                        .launchSpecifications(InstanceFleetProvisioningSpecificationsProperty.builder()
                                .spotSpecification(SpotProvisioningSpecificationProperty.builder()
                                        .allocationStrategy(EmrCreateCluster.getSpotAllocationStrategy().CAPACITY_OPTIMIZED)
                                        .timeoutAction(EmrCreateCluster.getSpotTimeoutAction().TERMINATE_CLUSTER)
                                        .timeout(Duration.minutes(5))
                                        .build())
                                .build())
                        .build()))
                .build())
        .name("SpotCluster")
        .integrationPattern(IntegrationPattern.RUN_JOB)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new EmrCreateCluster(this, "OnDemandSpecification", new EmrCreateClusterProps {
    Instances = new InstancesConfigProperty {
        InstanceFleets = new [] { new InstanceFleetConfigProperty {
            InstanceFleetType = EmrCreateCluster.InstanceRoleType.MASTER,
            LaunchSpecifications = new InstanceFleetProvisioningSpecificationsProperty {
                OnDemandSpecification = new OnDemandProvisioningSpecificationProperty {
                    AllocationStrategy = EmrCreateCluster.OnDemandAllocationStrategy.LOWEST_PRICE
                }
            }
        } }
    },
    Name = "OnDemandCluster",
    IntegrationPattern = IntegrationPattern.RUN_JOB
});

new EmrCreateCluster(this, "SpotSpecification", new EmrCreateClusterProps {
    Instances = new InstancesConfigProperty {
        InstanceFleets = new [] { new InstanceFleetConfigProperty {
            InstanceFleetType = EmrCreateCluster.InstanceRoleType.MASTER,
            LaunchSpecifications = new InstanceFleetProvisioningSpecificationsProperty {
                SpotSpecification = new SpotProvisioningSpecificationProperty {
                    AllocationStrategy = EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED,
                    TimeoutAction = EmrCreateCluster.SpotTimeoutAction.TERMINATE_CLUSTER,
                    Timeout = Duration.Minutes(5)
                }
            }
        } }
    },
    Name = "SpotCluster",
    IntegrationPattern = IntegrationPattern.RUN_JOB
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
tasks.NewEmrCreateCluster(this, jsii.String("OnDemandSpecification"), &EmrCreateClusterProps{
	Instances: &InstancesConfigProperty{
		InstanceFleets: []InstanceFleetConfigProperty{
			&InstanceFleetConfigProperty{
				InstanceFleetType: tasks.EmrCreateCluster.InstanceRoleType_MASTER,
				LaunchSpecifications: &InstanceFleetProvisioningSpecificationsProperty{
					OnDemandSpecification: &OnDemandProvisioningSpecificationProperty{
						AllocationStrategy: tasks.EmrCreateCluster.OnDemandAllocationStrategy_LOWEST_PRICE,
					},
				},
			},
		},
	},
	Name: jsii.String("OnDemandCluster"),
	IntegrationPattern: sfn.IntegrationPattern_RUN_JOB,
})

tasks.NewEmrCreateCluster(this, jsii.String("SpotSpecification"), &EmrCreateClusterProps{
	Instances: &InstancesConfigProperty{
		InstanceFleets: []InstanceFleetConfigProperty{
			&InstanceFleetConfigProperty{
				InstanceFleetType: tasks.EmrCreateCluster.InstanceRoleType_MASTER,
				LaunchSpecifications: &InstanceFleetProvisioningSpecificationsProperty{
					SpotSpecification: &SpotProvisioningSpecificationProperty{
						AllocationStrategy: tasks.EmrCreateCluster.SpotAllocationStrategy_CAPACITY_OPTIMIZED,
						TimeoutAction: tasks.EmrCreateCluster.SpotTimeoutAction_TERMINATE_CLUSTER,
						Timeout: awscdk.Duration_Minutes(jsii.Number(5)),
					},
				},
			},
		},
	},
	Name: jsii.String("SpotCluster"),
	IntegrationPattern: sfn.IntegrationPattern_RUN_JOB,
})

Properties ​

onDemandSpecificationoptionalEmrCreateCluster.OnDemandProvisioningSpecificationPropertyon_demand_specificationoptionalOnDemandProvisioningSpecificationPropertyonDemandSpecificationoptionalOnDemandProvisioningSpecificationPropertyOnDemandSpecificationoptionalOnDemandProvisioningSpecificationPropertyOnDemandSpecificationoptionalOnDemandProvisioningSpecificationProperty #
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.

Default: no on-demand specification

The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. On-Demand Instances allocation strategy is available in Amazon EMR releases 5.12.1 and later.

The launch specification for Spot instances in the fleet, which determines the defined duration and provisioning timeout behavior.

Default: no spot specification