Resource: aws_emr_managed_scaling_policy

Provides a Managed Scaling policy for EMR Cluster. With Amazon EMR versions 5.30.0 and later (except for Amazon EMR 6.0.0), you can enable EMR managed scaling to automatically increase or decrease the number of instances or units in your cluster based on workload. See Using EMR Managed Scaling in Amazon EMR for more information.

Example Usage

resource "aws_emr_cluster" "sample" {
  name          = "emr-sample-cluster"
  release_label = "emr-5.30.0"

  master_instance_group {
    instance_type = "m4.large"
  }

  core_instance_group {
    instance_type = "c4.large"
  }
  # skip ...
}

resource "aws_emr_managed_scaling_policy" "samplepolicy" {
  cluster_id = aws_emr_cluster.sample.id
  compute_limits {
    unit_type                       = "Instances"
    minimum_capacity_units          = 2
    maximum_capacity_units          = 10
    maximum_ondemand_capacity_units = 2
    maximum_core_capacity_units     = 10
  }
}

Argument Reference

This resource supports the following arguments:

compute_limits

Attribute Reference

This resource exports no additional attributes.

Import

In Terraform v1.5.0 and later, use an import block to import EMR Managed Scaling Policies using the EMR Cluster identifier. For example:

import {
  to = aws_emr_managed_scaling_policy.example
  id = "j-123456ABCDEF"
}

Using terraform import, import EMR Managed Scaling Policies using the EMR Cluster identifier. For example:

% terraform import aws_emr_managed_scaling_policy.example j-123456ABCDEF