Resource: aws_emr_instance_fleet

Provides an Elastic MapReduce Cluster Instance Fleet configuration. See Amazon Elastic MapReduce Documentation for more information.

Example Usage

resource "aws_emr_instance_fleet" "task" {
  cluster_id = aws_emr_cluster.cluster.id
  instance_type_configs {
    bid_price_as_percentage_of_on_demand_price = 100
    ebs_config {
      size                 = 100
      type                 = "gp2"
      volumes_per_instance = 1
    }
    instance_type     = "m4.xlarge"
    weighted_capacity = 1
  }
  instance_type_configs {
    bid_price_as_percentage_of_on_demand_price = 100
    ebs_config {
      size                 = 100
      type                 = "gp2"
      volumes_per_instance = 1
    }
    instance_type     = "m4.2xlarge"
    weighted_capacity = 2
  }
  launch_specifications {
    spot_specification {
      allocation_strategy      = "capacity-optimized"
      block_duration_minutes   = 0
      timeout_action           = "TERMINATE_CLUSTER"
      timeout_duration_minutes = 10
    }
  }
  name                      = "task fleet"
  target_on_demand_capacity = 1
  target_spot_capacity      = 1
}

Argument Reference

This resource supports the following arguments:

instance_type_configs Configuration Block

configurations Configuration Block

A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster. See Configuring Applications.

ebs_config

Attributes for the EBS volumes attached to each EC2 instance in the master_instance_group and core_instance_group configuration blocks:

launch_specifications Configuration Block

on_demand_specification Configuration Block

The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy. The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand instances allocation strategy is available in Amazon EMR version 5.12.1 and later.

spot_specification Configuration Block

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

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import EMR Instance Fleet using the EMR Cluster identifier and Instance Fleet identifier separated by a forward slash (/). For example:

import {
  to = aws_emr_instance_fleet.example
  id = "j-123456ABCDEF/if-15EK4O09RZLNR"
}

Using terraform import, import EMR Instance Fleet using the EMR Cluster identifier and Instance Fleet identifier separated by a forward slash (/). For example:

% terraform import aws_emr_instance_fleet.example j-123456ABCDEF/if-15EK4O09RZLNR