ManagedScalingPolicy class
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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const sample = new aws.emr.Cluster("sample", {
masterInstanceGroup: {
instanceType: "m4.large",
},
coreInstanceGroup: {
instanceType: "c4.large",
},
name: "emr-sample-cluster",
releaseLabel: "emr-5.30.0",
});
const samplepolicy = new aws.emr.ManagedScalingPolicy("samplepolicy", {
computeLimits: [{
unitType: "Instances",
minimumCapacityUnits: 2,
maximumCapacityUnits: 10,
maximumOndemandCapacityUnits: 2,
maximumCoreCapacityUnits: 10,
}],
clusterId: sample.id,
});
import pulumi
import pulumi_aws as aws
sample = aws.emr.Cluster("sample",
master_instance_group={
"instance_type": "m4.large",
},
core_instance_group={
"instance_type": "c4.large",
},
name="emr-sample-cluster",
release_label="emr-5.30.0")
samplepolicy = aws.emr.ManagedScalingPolicy("samplepolicy",
compute_limits=[{
"unit_type": "Instances",
"minimum_capacity_units": 2,
"maximum_capacity_units": 10,
"maximum_ondemand_capacity_units": 2,
"maximum_core_capacity_units": 10,
}],
cluster_id=sample.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var sample = new Aws.Emr.Cluster("sample", new()
{
MasterInstanceGroup = new Aws.Emr.Inputs.ClusterMasterInstanceGroupArgs
{
InstanceType = "m4.large",
},
CoreInstanceGroup = new Aws.Emr.Inputs.ClusterCoreInstanceGroupArgs
{
InstanceType = "c4.large",
},
Name = "emr-sample-cluster",
ReleaseLabel = "emr-5.30.0",
});
var samplepolicy = new Aws.Emr.ManagedScalingPolicy("samplepolicy", new()
{
ComputeLimits = new[]
{
new Aws.Emr.Inputs.ManagedScalingPolicyComputeLimitArgs
{
UnitType = "Instances",
MinimumCapacityUnits = 2,
MaximumCapacityUnits = 10,
MaximumOndemandCapacityUnits = 2,
MaximumCoreCapacityUnits = 10,
},
},
ClusterId = sample.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/emr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
sample, err := emr.NewCluster(ctx, "sample", &emr.ClusterArgs{
MasterInstanceGroup: &emr.ClusterMasterInstanceGroupArgs{
InstanceType: pulumi.String("m4.large"),
},
CoreInstanceGroup: &emr.ClusterCoreInstanceGroupArgs{
InstanceType: pulumi.String("c4.large"),
},
Name: pulumi.String("emr-sample-cluster"),
ReleaseLabel: pulumi.String("emr-5.30.0"),
})
if err != nil {
return err
}
_, err = emr.NewManagedScalingPolicy(ctx, "samplepolicy", &emr.ManagedScalingPolicyArgs{
ComputeLimits: emr.ManagedScalingPolicyComputeLimitArray{
&emr.ManagedScalingPolicyComputeLimitArgs{
UnitType: pulumi.String("Instances"),
MinimumCapacityUnits: pulumi.Int(2),
MaximumCapacityUnits: pulumi.Int(10),
MaximumOndemandCapacityUnits: pulumi.Int(2),
MaximumCoreCapacityUnits: pulumi.Int(10),
},
},
ClusterId: sample.ID().ToIDOutput().ToStringOutput(),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_emr_cluster" "sample" {
master_instance_group = {
instance_type = "m4.large"
}
core_instance_group = {
instance_type = "c4.large"
}
name = "emr-sample-cluster"
release_label = "emr-5.30.0"
}
resource "aws_emr_managedscalingpolicy" "samplepolicy" {
compute_limits {
unit_type = "Instances"
minimum_capacity_units = 2
maximum_capacity_units = 10
maximum_ondemand_capacity_units = 2
maximum_core_capacity_units = 10
}
cluster_id = aws_emr_cluster.sample.id
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.emr.Cluster;
import com.pulumi.aws.emr.ClusterArgs;
import com.pulumi.aws.emr.inputs.ClusterMasterInstanceGroupArgs;
import com.pulumi.aws.emr.inputs.ClusterCoreInstanceGroupArgs;
import com.pulumi.aws.emr.ManagedScalingPolicy;
import com.pulumi.aws.emr.ManagedScalingPolicyArgs;
import com.pulumi.aws.emr.inputs.ManagedScalingPolicyComputeLimitArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 sample = new Cluster("sample", ClusterArgs.builder()
.masterInstanceGroup(ClusterMasterInstanceGroupArgs.builder()
.instanceType("m4.large")
.build())
.coreInstanceGroup(ClusterCoreInstanceGroupArgs.builder()
.instanceType("c4.large")
.build())
.name("emr-sample-cluster")
.releaseLabel("emr-5.30.0")
.build());
var samplepolicy = new ManagedScalingPolicy("samplepolicy", ManagedScalingPolicyArgs.builder()
.computeLimits(ManagedScalingPolicyComputeLimitArgs.builder()
.unitType("Instances")
.minimumCapacityUnits(2)
.maximumCapacityUnits(10)
.maximumOndemandCapacityUnits(2)
.maximumCoreCapacityUnits(10)
.build())
.clusterId(sample.id())
.build());
}
}
resources:
sample:
type: aws:emr:Cluster
properties:
masterInstanceGroup:
instanceType: m4.large
coreInstanceGroup:
instanceType: c4.large
name: emr-sample-cluster
releaseLabel: emr-5.30.0
samplepolicy:
type: aws:emr:ManagedScalingPolicy
properties:
computeLimits:
- unitType: Instances
minimumCapacityUnits: 2
maximumCapacityUnits: 10
maximumOndemandCapacityUnits: 2
maximumCoreCapacityUnits: 10
clusterId: ${sample.id}
Import
Using pulumi import, import EMR Managed Scaling Policies using the EMR Cluster identifier. For example:
$ pulumi import aws:emr/managedScalingPolicy:ManagedScalingPolicy example j-123456ABCDEF
Constructors
- ManagedScalingPolicy(String name, {ManagedScalingPolicyArgs? args, CustomResourceOptions? options})
-
Creates a new ManagedScalingPolicy.
nameThe Pulumi resource name.argsArguments used to configure this ManagedScalingPolicy. The set of arguments for ManagedScalingPolicy.optionsResource options controlling this resource's behavior. - ManagedScalingPolicy.reference(String urn)
- Creates a typed reference to an existing ManagedScalingPolicy resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
clusterId
↔ Output<
String> -
ID of the EMR cluster
latefinal
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
computeLimits
↔ Output<
List< ManagedScalingPolicyComputeLimit> > -
Configuration block with compute limit settings. Described below.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scalingStrategy
↔ Output<
String?> -
Specifies the scaling strategy. When set to
ADVANCED, theutilizationPerformanceIndexargument can be used to configure an advanced scaling strategy. An advanced scaling strategy requires Amazon EMR on EC2 version 7.0 or later. Valid values:ADVANCED,DEFAULT.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
utilizationPerformanceIndex
↔ Output<
int?> -
Integer value that represents the advanced scaling strategy. Higher values optimize for performance, while lower values optimize for resource conservation. A value of
50provides a balance between performance and resource conservation. See the AWS documentation for more details. Required whenscalingStrategyis set toADVANCED. Valid values:1,25,50,75,100.latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ManagedScalingPolicyState? state, CustomResourceOptions? options}) → ManagedScalingPolicy -
Gets an existing ManagedScalingPolicy resource's state with the given
nameandid.