google_dataproc_autoscaling_policy

Describes an autoscaling policy for Dataproc cluster autoscaler.

Open in Cloud Shell

Example Usage - Dataproc Autoscaling Policy

resource "google_dataproc_cluster" "basic" {
  name     = "dataproc-policy"
  region   = "us-central1"

  cluster_config {
    autoscaling_config {
      policy_uri = google_dataproc_autoscaling_policy.asp.name
    }
  }
}

resource "google_dataproc_autoscaling_policy" "asp" {
  policy_id = "dataproc-policy"
  location  = "us-central1"

  worker_config {
    max_instances = 3
  }

  basic_algorithm {
    yarn_config {
      graceful_decommission_timeout = "30s"

      scale_up_factor   = 0.5
      scale_down_factor = 0.5
    }
  }
}

Argument Reference

The following arguments are supported:


The worker_config block supports:

The secondary_worker_config block supports:

The basic_algorithm block supports:

The yarn_config block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

AutoscalingPolicy can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import AutoscalingPolicy using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/autoscalingPolicies/{{policy_id}}"
  to = google_dataproc_autoscaling_policy.default
}

When using the terraform import command, AutoscalingPolicy can be imported using one of the formats above. For example:

$ terraform import google_dataproc_autoscaling_policy.default projects/{{project}}/locations/{{location}}/autoscalingPolicies/{{policy_id}}
$ terraform import google_dataproc_autoscaling_policy.default {{project}}/{{location}}/{{policy_id}}
$ terraform import google_dataproc_autoscaling_policy.default {{location}}/{{policy_id}}

User Project Overrides

This resource supports User Project Overrides.