Skip to content

Resource: awsEmrManagedScalingPolicy

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

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsEmrClusterSample = new aws.emrCluster.EmrCluster(this, "sample", {
  coreInstanceGroup: {
    instanceType: "c4.large",
  },
  masterInstanceGroup: {
    instanceType: "m4.large",
  },
  name: "emr-sample-cluster",
  releaseLabel: "emr-5.30.0",
});
new aws.emrManagedScalingPolicy.EmrManagedScalingPolicy(this, "samplepolicy", {
  clusterId: awsEmrClusterSample.id,
  computeLimits: [
    {
      maximumCapacityUnits: 10,
      maximumCoreCapacityUnits: 10,
      maximumOndemandCapacityUnits: 2,
      minimumCapacityUnits: 2,
      unitType: "Instances",
    },
  ],
});

Argument Reference

The following arguments are supported:

  • clusterId - (Required) ID of the EMR cluster
  • computeLimits - (Required) Configuration block with compute limit settings. Described below.

computeLimits

  • unitType - (Required) The unit type used for specifying a managed scaling policy. Valid Values: instanceFleetUnits | instances | vcpu
  • minimumCapacityUnits - (Required) The lower boundary of EC2 units. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
  • maximumCapacityUnits - (Required) The upper boundary of EC2 units. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
  • maximumOndemandCapacityUnits - (Optional) The upper boundary of On-Demand EC2 units. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. The On-Demand units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between On-Demand and Spot instances.
  • maximumCoreCapacityUnits - (Optional) The upper boundary of EC2 units for core node type in a cluster. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. The core units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between core and task nodes.

Attributes Reference

No additional attributes are exported.

Import

EMR Managed Scaling Policies can be imported via the EMR Cluster identifier, e.g.,

$ terraform import aws_emr_managed_scaling_policy.example j-123456ABCDEF