AutoscalingPolicyArgs

data class AutoscalingPolicyArgs(val basicAlgorithm: Output<AutoscalingPolicyBasicAlgorithmArgs>? = null, val location: Output<String>? = null, val policyId: Output<String>? = null, val project: Output<String>? = null, val secondaryWorkerConfig: Output<AutoscalingPolicySecondaryWorkerConfigArgs>? = null, val workerConfig: Output<AutoscalingPolicyWorkerConfigArgs>? = null) : ConvertibleToJava<AutoscalingPolicyArgs>

Describes an autoscaling policy for Dataproc cluster autoscaler.

Example Usage

Dataproc Autoscaling Policy

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.dataproc.AutoscalingPolicy;
import com.pulumi.gcp.dataproc.AutoscalingPolicyArgs;
import com.pulumi.gcp.dataproc.inputs.AutoscalingPolicyWorkerConfigArgs;
import com.pulumi.gcp.dataproc.inputs.AutoscalingPolicyBasicAlgorithmArgs;
import com.pulumi.gcp.dataproc.inputs.AutoscalingPolicyBasicAlgorithmYarnConfigArgs;
import com.pulumi.gcp.dataproc.Cluster;
import com.pulumi.gcp.dataproc.ClusterArgs;
import com.pulumi.gcp.dataproc.inputs.ClusterClusterConfigArgs;
import com.pulumi.gcp.dataproc.inputs.ClusterClusterConfigAutoscalingConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var asp = new AutoscalingPolicy("asp", AutoscalingPolicyArgs.builder()
.policyId("dataproc-policy")
.location("us-central1")
.workerConfig(AutoscalingPolicyWorkerConfigArgs.builder()
.maxInstances(3)
.build())
.basicAlgorithm(AutoscalingPolicyBasicAlgorithmArgs.builder()
.yarnConfig(AutoscalingPolicyBasicAlgorithmYarnConfigArgs.builder()
.gracefulDecommissionTimeout("30s")
.scaleUpFactor(0.5)
.scaleDownFactor(0.5)
.build())
.build())
.build());
var basic = new Cluster("basic", ClusterArgs.builder()
.region("us-central1")
.clusterConfig(ClusterClusterConfigArgs.builder()
.autoscalingConfig(ClusterClusterConfigAutoscalingConfigArgs.builder()
.policyUri(asp.name())
.build())
.build())
.build());
}
}

Import

AutoscalingPolicy can be imported using any of these accepted formats

$ pulumi import gcp:dataproc/autoscalingPolicy:AutoscalingPolicy default projects/{{project}}/locations/{{location}}/autoscalingPolicies/{{policy_id}}
$ pulumi import gcp:dataproc/autoscalingPolicy:AutoscalingPolicy default {{project}}/{{location}}/{{policy_id}}
$ pulumi import gcp:dataproc/autoscalingPolicy:AutoscalingPolicy default {{location}}/{{policy_id}}

Constructors

Link copied to clipboard
constructor(basicAlgorithm: Output<AutoscalingPolicyBasicAlgorithmArgs>? = null, location: Output<String>? = null, policyId: Output<String>? = null, project: Output<String>? = null, secondaryWorkerConfig: Output<AutoscalingPolicySecondaryWorkerConfigArgs>? = null, workerConfig: Output<AutoscalingPolicyWorkerConfigArgs>? = null)

Properties

Link copied to clipboard

Basic algorithm for autoscaling. Structure is documented below.

Link copied to clipboard
val location: Output<String>? = null

The location where the autoscaling policy should reside. The default value is global.

Link copied to clipboard
val policyId: Output<String>? = null

The policy id. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard

Describes how the autoscaler will operate for secondary workers. Structure is documented below.

Link copied to clipboard

Describes how the autoscaler will operate for primary workers. Structure is documented below.

Functions

Link copied to clipboard
open override fun toJava(): AutoscalingPolicyArgs