InstanceFleet class
Provides an Elastic MapReduce Cluster Instance Fleet configuration. See Amazon Elastic MapReduce Documentation for more information.
> NOTE: At this time, Instance Fleets cannot be destroyed through the API nor web interface. Instance Fleets are destroyed when the EMR Cluster is destroyed. the provider will resize any Instance Fleet to zero when destroying the resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const task = new aws.emr.InstanceFleet("task", {
launchSpecifications: {
spotSpecifications: [{
allocationStrategy: "capacity-optimized",
blockDurationMinutes: 0,
timeoutAction: "TERMINATE_CLUSTER",
timeoutDurationMinutes: 10,
}],
},
instanceTypeConfigs: [
{
ebsConfigs: [{
size: 100,
type: "gp2",
volumesPerInstance: 1,
}],
bidPriceAsPercentageOfOnDemandPrice: 100,
instanceType: "m4.xlarge",
weightedCapacity: 1,
},
{
ebsConfigs: [{
size: 100,
type: "gp2",
volumesPerInstance: 1,
}],
bidPriceAsPercentageOfOnDemandPrice: 100,
instanceType: "m4.2xlarge",
weightedCapacity: 2,
},
],
clusterId: cluster.id,
name: "task fleet",
targetOnDemandCapacity: 1,
targetSpotCapacity: 1,
});
import pulumi
import pulumi_aws as aws
task = aws.emr.InstanceFleet("task",
launch_specifications={
"spot_specifications": [{
"allocation_strategy": "capacity-optimized",
"block_duration_minutes": 0,
"timeout_action": "TERMINATE_CLUSTER",
"timeout_duration_minutes": 10,
}],
},
instance_type_configs=[
{
"ebs_configs": [{
"size": 100,
"type": "gp2",
"volumes_per_instance": 1,
}],
"bid_price_as_percentage_of_on_demand_price": float(100),
"instance_type": "m4.xlarge",
"weighted_capacity": 1,
},
{
"ebs_configs": [{
"size": 100,
"type": "gp2",
"volumes_per_instance": 1,
}],
"bid_price_as_percentage_of_on_demand_price": float(100),
"instance_type": "m4.2xlarge",
"weighted_capacity": 2,
},
],
cluster_id=cluster["id"],
name="task fleet",
target_on_demand_capacity=1,
target_spot_capacity=1)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var task = new Aws.Emr.InstanceFleet("task", new()
{
LaunchSpecifications = new Aws.Emr.Inputs.InstanceFleetLaunchSpecificationsArgs
{
SpotSpecifications = new[]
{
new Aws.Emr.Inputs.InstanceFleetLaunchSpecificationsSpotSpecificationArgs
{
AllocationStrategy = "capacity-optimized",
BlockDurationMinutes = 0,
TimeoutAction = "TERMINATE_CLUSTER",
TimeoutDurationMinutes = 10,
},
},
},
InstanceTypeConfigs = new[]
{
new Aws.Emr.Inputs.InstanceFleetInstanceTypeConfigArgs
{
EbsConfigs = new[]
{
new Aws.Emr.Inputs.InstanceFleetInstanceTypeConfigEbsConfigArgs
{
Size = 100,
Type = "gp2",
VolumesPerInstance = 1,
},
},
BidPriceAsPercentageOfOnDemandPrice = 100,
InstanceType = "m4.xlarge",
WeightedCapacity = 1,
},
new Aws.Emr.Inputs.InstanceFleetInstanceTypeConfigArgs
{
EbsConfigs = new[]
{
new Aws.Emr.Inputs.InstanceFleetInstanceTypeConfigEbsConfigArgs
{
Size = 100,
Type = "gp2",
VolumesPerInstance = 1,
},
},
BidPriceAsPercentageOfOnDemandPrice = 100,
InstanceType = "m4.2xlarge",
WeightedCapacity = 2,
},
},
ClusterId = cluster.Id,
Name = "task fleet",
TargetOnDemandCapacity = 1,
TargetSpotCapacity = 1,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/emr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := emr.NewInstanceFleet(ctx, "task", &emr.InstanceFleetArgs{
LaunchSpecifications: &emr.InstanceFleetLaunchSpecificationsArgs{
SpotSpecifications: emr.InstanceFleetLaunchSpecificationsSpotSpecificationArray{
&emr.InstanceFleetLaunchSpecificationsSpotSpecificationArgs{
AllocationStrategy: pulumi.String("capacity-optimized"),
BlockDurationMinutes: pulumi.Int(0),
TimeoutAction: pulumi.String("TERMINATE_CLUSTER"),
TimeoutDurationMinutes: pulumi.Int(10),
},
},
},
InstanceTypeConfigs: emr.InstanceFleetInstanceTypeConfigArray{
&emr.InstanceFleetInstanceTypeConfigArgs{
EbsConfigs: emr.InstanceFleetInstanceTypeConfigEbsConfigArray{
&emr.InstanceFleetInstanceTypeConfigEbsConfigArgs{
Size: pulumi.Int(100),
Type: pulumi.String("gp2"),
VolumesPerInstance: pulumi.Int(1),
},
},
BidPriceAsPercentageOfOnDemandPrice: pulumi.Float64(100),
InstanceType: pulumi.String("m4.xlarge"),
WeightedCapacity: pulumi.Int(1),
},
&emr.InstanceFleetInstanceTypeConfigArgs{
EbsConfigs: emr.InstanceFleetInstanceTypeConfigEbsConfigArray{
&emr.InstanceFleetInstanceTypeConfigEbsConfigArgs{
Size: pulumi.Int(100),
Type: pulumi.String("gp2"),
VolumesPerInstance: pulumi.Int(1),
},
},
BidPriceAsPercentageOfOnDemandPrice: pulumi.Float64(100),
InstanceType: pulumi.String("m4.2xlarge"),
WeightedCapacity: pulumi.Int(2),
},
},
ClusterId: pulumi.Any(cluster.Id),
Name: pulumi.String("task fleet"),
TargetOnDemandCapacity: pulumi.Int(1),
TargetSpotCapacity: pulumi.Int(1),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_emr_instancefleet" "task" {
launch_specifications = {
spot_specifications = [{
"allocationStrategy" = "capacity-optimized"
"blockDurationMinutes" = 0
"timeoutAction" = "TERMINATE_CLUSTER"
"timeoutDurationMinutes" = 10
}]
}
instance_type_configs {
ebs_configs {
size = 100
type = "gp2"
volumes_per_instance = 1
}
bid_price_as_percentage_of_on_demand_price = 100
instance_type = "m4.xlarge"
weighted_capacity = 1
}
instance_type_configs {
ebs_configs {
size = 100
type = "gp2"
volumes_per_instance = 1
}
bid_price_as_percentage_of_on_demand_price = 100
instance_type = "m4.2xlarge"
weighted_capacity = 2
}
cluster_id = cluster.id
name = "task fleet"
target_on_demand_capacity = 1
target_spot_capacity = 1
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.emr.InstanceFleet;
import com.pulumi.aws.emr.InstanceFleetArgs;
import com.pulumi.aws.emr.inputs.InstanceFleetLaunchSpecificationsArgs;
import com.pulumi.aws.emr.inputs.InstanceFleetLaunchSpecificationsSpotSpecificationArgs;
import com.pulumi.aws.emr.inputs.InstanceFleetInstanceTypeConfigArgs;
import com.pulumi.aws.emr.inputs.InstanceFleetInstanceTypeConfigEbsConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var task = new InstanceFleet("task", InstanceFleetArgs.builder()
.launchSpecifications(InstanceFleetLaunchSpecificationsArgs.builder()
.spotSpecifications(InstanceFleetLaunchSpecificationsSpotSpecificationArgs.builder()
.allocationStrategy("capacity-optimized")
.blockDurationMinutes(0)
.timeoutAction("TERMINATE_CLUSTER")
.timeoutDurationMinutes(10)
.build())
.build())
.instanceTypeConfigs(
InstanceFleetInstanceTypeConfigArgs.builder()
.ebsConfigs(InstanceFleetInstanceTypeConfigEbsConfigArgs.builder()
.size(100)
.type("gp2")
.volumesPerInstance(1)
.build())
.bidPriceAsPercentageOfOnDemandPrice(100.0)
.instanceType("m4.xlarge")
.weightedCapacity(1)
.build(),
InstanceFleetInstanceTypeConfigArgs.builder()
.ebsConfigs(InstanceFleetInstanceTypeConfigEbsConfigArgs.builder()
.size(100)
.type("gp2")
.volumesPerInstance(1)
.build())
.bidPriceAsPercentageOfOnDemandPrice(100.0)
.instanceType("m4.2xlarge")
.weightedCapacity(2)
.build())
.clusterId(cluster.id())
.name("task fleet")
.targetOnDemandCapacity(1)
.targetSpotCapacity(1)
.build());
}
}
resources:
task:
type: aws:emr:InstanceFleet
properties:
launchSpecifications:
spotSpecifications:
- allocationStrategy: capacity-optimized
blockDurationMinutes: 0
timeoutAction: TERMINATE_CLUSTER
timeoutDurationMinutes: 10
instanceTypeConfigs:
- ebsConfigs:
- size: 100
type: gp2
volumesPerInstance: 1
bidPriceAsPercentageOfOnDemandPrice: 100
instanceType: m4.xlarge
weightedCapacity: 1
- ebsConfigs:
- size: 100
type: gp2
volumesPerInstance: 1
bidPriceAsPercentageOfOnDemandPrice: 100
instanceType: m4.2xlarge
weightedCapacity: 2
clusterId: ${cluster.id}
name: task fleet
targetOnDemandCapacity: 1
targetSpotCapacity: 1
Import
Using pulumi import, import EMR Instance Fleet using the EMR Cluster identifier and Instance Fleet identifier separated by a forward slash (/). For example:
$ pulumi import aws:emr/instanceFleet:InstanceFleet example j-123456ABCDEF/if-15EK4O09RZLNR
Constructors
- InstanceFleet(String name, {InstanceFleetArgs? args, CustomResourceOptions? options})
-
Creates a new InstanceFleet.
nameThe Pulumi resource name.argsArguments used to configure this InstanceFleet. The set of arguments for InstanceFleet.optionsResource options controlling this resource's behavior. - InstanceFleet.reference(String urn)
- Creates a typed reference to an existing InstanceFleet resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
clusterId
↔ Output<
String> -
ID of the EMR Cluster to attach to. Changing this forces a new resource to be created.
latefinal
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
instanceTypeConfigs
↔ Output<
List< InstanceFleetInstanceTypeConfig> ?> -
Configuration block for instance fleet
latefinal
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
launchSpecifications
↔ Output<
InstanceFleetLaunchSpecifications?> -
Configuration block for launch specification
latefinal
-
name
↔ Output<
String> -
Friendly name given to the instance fleet.
latefinal
-
provisionedOnDemandCapacity
↔ Output<
int> -
The number of On-Demand units that have been provisioned for the instance
fleet to fulfill TargetOnDemandCapacity. This provisioned capacity might be less than or greater than TargetOnDemandCapacity.
latefinal
-
provisionedSpotCapacity
↔ Output<
int> -
The number of Spot units that have been provisioned for this instance fleet
to fulfill TargetSpotCapacity. This provisioned capacity might be less than or greater than TargetSpotCapacity.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
targetOnDemandCapacity
↔ Output<
int?> -
The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision.
latefinal
-
targetSpotCapacity
↔ Output<
int?> -
The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {InstanceFleetState? state, CustomResourceOptions? options}) → InstanceFleet -
Gets an existing InstanceFleet resource's state with the given
nameandid.