AWS Amazon EMR Managed Scaling Policy

This page shows how to write Terraform and CloudFormation for Amazon EMR Managed Scaling Policy and write them securely.

aws_emr_managed_scaling_policy (Terraform)

The Managed Scaling Policy in Amazon EMR can be configured in Terraform with the resource name aws_emr_managed_scaling_policy. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L7
resource "aws_emr_managed_scaling_policy" "this" {
  cluster_id = var.cluster_id

  dynamic "compute_limits" {
    for_each = var.compute_limits
    content {
emr_managed_scaling_policy.tf#L4
resource "aws_emr_managed_scaling_policy" "emr_managed_scaling_policy" {
  count = var.enable_emr_managed_scaling_policy ? 1 : 0

  cluster_id = var.emr_managed_scaling_policy_cluster_id != "" ? var.emr_managed_scaling_policy_cluster_id : (var.enable_emr_cluster ? aws_emr_cluster.emr_cluster.0.id : null)

  dynamic "compute_limits" {
emr_managed_scaling_policy.tf#L4
resource "aws_emr_managed_scaling_policy" "emr_managed_scaling_policy" {
  count = var.enable_emr_managed_scaling_policy ? 1 : 0

  cluster_id = var.emr_managed_scaling_policy_cluster_id != "" ? var.emr_managed_scaling_policy_cluster_id : (var.enable_emr_cluster ? aws_emr_cluster.emr_cluster.0.id : null)

  dynamic "compute_limits" {
emr_managed_scaling_policy.tf#L4
resource "aws_emr_managed_scaling_policy" "emr_managed_scaling_policy" {
  count = var.enable_emr_managed_scaling_policy ? 1 : 0

  cluster_id = var.emr_managed_scaling_policy_cluster_id != "" ? var.emr_managed_scaling_policy_cluster_id : (var.enable_emr_cluster ? aws_emr_cluster.emr_cluster.0.id : null)

  dynamic "compute_limits" {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

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.

AWS::EMR::Cluster ManagedScalingPolicy (CloudFormation)

The Cluster ManagedScalingPolicy in EMR can be configured in CloudFormation with the resource name AWS::EMR::Cluster ManagedScalingPolicy. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

ComputeLimits The EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster is not allowed to go above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
Required: No
Type: ComputeLimits
Update requires: No interruption

Explanation in CloudFormation Registry

Managed scaling policy for an Amazon EMR cluster. The policy specifies the limits for resources that can be added or terminated from a cluster. The policy only applies to the core and task nodes. The master node cannot be scaled after initial configuration.

Frequently asked questions

What is AWS Amazon EMR Managed Scaling Policy?

AWS Amazon EMR Managed Scaling Policy is a resource for Amazon EMR of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon EMR Managed Scaling Policy?

For Terraform, the niveklabs/aws, SebastianUA/terraform-aws-emr and SebastianUA/terraform source code examples are useful. See the Terraform Example section for further details.