aws.emr.ManagedScalingPolicy
Explore with Pulumi AI
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", {
    name: "emr-sample-cluster",
    releaseLabel: "emr-5.30.0",
    masterInstanceGroup: {
        instanceType: "m4.large",
    },
    coreInstanceGroup: {
        instanceType: "c4.large",
    },
});
const samplepolicy = new aws.emr.ManagedScalingPolicy("samplepolicy", {
    clusterId: sample.id,
    computeLimits: [{
        unitType: "Instances",
        minimumCapacityUnits: 2,
        maximumCapacityUnits: 10,
        maximumOndemandCapacityUnits: 2,
        maximumCoreCapacityUnits: 10,
    }],
});
import pulumi
import pulumi_aws as aws
sample = aws.emr.Cluster("sample",
    name="emr-sample-cluster",
    release_label="emr-5.30.0",
    master_instance_group={
        "instance_type": "m4.large",
    },
    core_instance_group={
        "instance_type": "c4.large",
    })
samplepolicy = aws.emr.ManagedScalingPolicy("samplepolicy",
    cluster_id=sample.id,
    compute_limits=[{
        "unit_type": "Instances",
        "minimum_capacity_units": 2,
        "maximum_capacity_units": 10,
        "maximum_ondemand_capacity_units": 2,
        "maximum_core_capacity_units": 10,
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/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{
			Name:         pulumi.String("emr-sample-cluster"),
			ReleaseLabel: pulumi.String("emr-5.30.0"),
			MasterInstanceGroup: &emr.ClusterMasterInstanceGroupArgs{
				InstanceType: pulumi.String("m4.large"),
			},
			CoreInstanceGroup: &emr.ClusterCoreInstanceGroupArgs{
				InstanceType: pulumi.String("c4.large"),
			},
		})
		if err != nil {
			return err
		}
		_, err = emr.NewManagedScalingPolicy(ctx, "samplepolicy", &emr.ManagedScalingPolicyArgs{
			ClusterId: sample.ID(),
			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),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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()
    {
        Name = "emr-sample-cluster",
        ReleaseLabel = "emr-5.30.0",
        MasterInstanceGroup = new Aws.Emr.Inputs.ClusterMasterInstanceGroupArgs
        {
            InstanceType = "m4.large",
        },
        CoreInstanceGroup = new Aws.Emr.Inputs.ClusterCoreInstanceGroupArgs
        {
            InstanceType = "c4.large",
        },
    });
    var samplepolicy = new Aws.Emr.ManagedScalingPolicy("samplepolicy", new()
    {
        ClusterId = sample.Id,
        ComputeLimits = new[]
        {
            new Aws.Emr.Inputs.ManagedScalingPolicyComputeLimitArgs
            {
                UnitType = "Instances",
                MinimumCapacityUnits = 2,
                MaximumCapacityUnits = 10,
                MaximumOndemandCapacityUnits = 2,
                MaximumCoreCapacityUnits = 10,
            },
        },
    });
});
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.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 sample = new Cluster("sample", ClusterArgs.builder()
            .name("emr-sample-cluster")
            .releaseLabel("emr-5.30.0")
            .masterInstanceGroup(ClusterMasterInstanceGroupArgs.builder()
                .instanceType("m4.large")
                .build())
            .coreInstanceGroup(ClusterCoreInstanceGroupArgs.builder()
                .instanceType("c4.large")
                .build())
            .build());
        var samplepolicy = new ManagedScalingPolicy("samplepolicy", ManagedScalingPolicyArgs.builder()
            .clusterId(sample.id())
            .computeLimits(ManagedScalingPolicyComputeLimitArgs.builder()
                .unitType("Instances")
                .minimumCapacityUnits(2)
                .maximumCapacityUnits(10)
                .maximumOndemandCapacityUnits(2)
                .maximumCoreCapacityUnits(10)
                .build())
            .build());
    }
}
resources:
  sample:
    type: aws:emr:Cluster
    properties:
      name: emr-sample-cluster
      releaseLabel: emr-5.30.0
      masterInstanceGroup:
        instanceType: m4.large
      coreInstanceGroup:
        instanceType: c4.large
  samplepolicy:
    type: aws:emr:ManagedScalingPolicy
    properties:
      clusterId: ${sample.id}
      computeLimits:
        - unitType: Instances
          minimumCapacityUnits: 2
          maximumCapacityUnits: 10
          maximumOndemandCapacityUnits: 2
          maximumCoreCapacityUnits: 10
Create ManagedScalingPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagedScalingPolicy(name: string, args: ManagedScalingPolicyArgs, opts?: CustomResourceOptions);@overload
def ManagedScalingPolicy(resource_name: str,
                         args: ManagedScalingPolicyArgs,
                         opts: Optional[ResourceOptions] = None)
@overload
def ManagedScalingPolicy(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         cluster_id: Optional[str] = None,
                         compute_limits: Optional[Sequence[ManagedScalingPolicyComputeLimitArgs]] = None)func NewManagedScalingPolicy(ctx *Context, name string, args ManagedScalingPolicyArgs, opts ...ResourceOption) (*ManagedScalingPolicy, error)public ManagedScalingPolicy(string name, ManagedScalingPolicyArgs args, CustomResourceOptions? opts = null)
public ManagedScalingPolicy(String name, ManagedScalingPolicyArgs args)
public ManagedScalingPolicy(String name, ManagedScalingPolicyArgs args, CustomResourceOptions options)
type: aws:emr:ManagedScalingPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ManagedScalingPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ManagedScalingPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ManagedScalingPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedScalingPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagedScalingPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var managedScalingPolicyResource = new Aws.Emr.ManagedScalingPolicy("managedScalingPolicyResource", new()
{
    ClusterId = "string",
    ComputeLimits = new[]
    {
        new Aws.Emr.Inputs.ManagedScalingPolicyComputeLimitArgs
        {
            MaximumCapacityUnits = 0,
            MinimumCapacityUnits = 0,
            UnitType = "string",
            MaximumCoreCapacityUnits = 0,
            MaximumOndemandCapacityUnits = 0,
        },
    },
});
example, err := emr.NewManagedScalingPolicy(ctx, "managedScalingPolicyResource", &emr.ManagedScalingPolicyArgs{
	ClusterId: pulumi.String("string"),
	ComputeLimits: emr.ManagedScalingPolicyComputeLimitArray{
		&emr.ManagedScalingPolicyComputeLimitArgs{
			MaximumCapacityUnits:         pulumi.Int(0),
			MinimumCapacityUnits:         pulumi.Int(0),
			UnitType:                     pulumi.String("string"),
			MaximumCoreCapacityUnits:     pulumi.Int(0),
			MaximumOndemandCapacityUnits: pulumi.Int(0),
		},
	},
})
var managedScalingPolicyResource = new ManagedScalingPolicy("managedScalingPolicyResource", ManagedScalingPolicyArgs.builder()
    .clusterId("string")
    .computeLimits(ManagedScalingPolicyComputeLimitArgs.builder()
        .maximumCapacityUnits(0)
        .minimumCapacityUnits(0)
        .unitType("string")
        .maximumCoreCapacityUnits(0)
        .maximumOndemandCapacityUnits(0)
        .build())
    .build());
managed_scaling_policy_resource = aws.emr.ManagedScalingPolicy("managedScalingPolicyResource",
    cluster_id="string",
    compute_limits=[{
        "maximum_capacity_units": 0,
        "minimum_capacity_units": 0,
        "unit_type": "string",
        "maximum_core_capacity_units": 0,
        "maximum_ondemand_capacity_units": 0,
    }])
const managedScalingPolicyResource = new aws.emr.ManagedScalingPolicy("managedScalingPolicyResource", {
    clusterId: "string",
    computeLimits: [{
        maximumCapacityUnits: 0,
        minimumCapacityUnits: 0,
        unitType: "string",
        maximumCoreCapacityUnits: 0,
        maximumOndemandCapacityUnits: 0,
    }],
});
type: aws:emr:ManagedScalingPolicy
properties:
    clusterId: string
    computeLimits:
        - maximumCapacityUnits: 0
          maximumCoreCapacityUnits: 0
          maximumOndemandCapacityUnits: 0
          minimumCapacityUnits: 0
          unitType: string
ManagedScalingPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ManagedScalingPolicy resource accepts the following input properties:
- ClusterId string
- ID of the EMR cluster
- ComputeLimits List<ManagedScaling Policy Compute Limit> 
- Configuration block with compute limit settings. Described below.
- ClusterId string
- ID of the EMR cluster
- ComputeLimits []ManagedScaling Policy Compute Limit Args 
- Configuration block with compute limit settings. Described below.
- clusterId String
- ID of the EMR cluster
- computeLimits List<ManagedScaling Policy Compute Limit> 
- Configuration block with compute limit settings. Described below.
- clusterId string
- ID of the EMR cluster
- computeLimits ManagedScaling Policy Compute Limit[] 
- Configuration block with compute limit settings. Described below.
- cluster_id str
- ID of the EMR cluster
- compute_limits Sequence[ManagedScaling Policy Compute Limit Args] 
- Configuration block with compute limit settings. Described below.
- clusterId String
- ID of the EMR cluster
- computeLimits List<Property Map>
- Configuration block with compute limit settings. Described below.
Outputs
All input properties are implicitly available as output properties. Additionally, the ManagedScalingPolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ManagedScalingPolicy Resource
Get an existing ManagedScalingPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ManagedScalingPolicyState, opts?: CustomResourceOptions): ManagedScalingPolicy@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        compute_limits: Optional[Sequence[ManagedScalingPolicyComputeLimitArgs]] = None) -> ManagedScalingPolicyfunc GetManagedScalingPolicy(ctx *Context, name string, id IDInput, state *ManagedScalingPolicyState, opts ...ResourceOption) (*ManagedScalingPolicy, error)public static ManagedScalingPolicy Get(string name, Input<string> id, ManagedScalingPolicyState? state, CustomResourceOptions? opts = null)public static ManagedScalingPolicy get(String name, Output<String> id, ManagedScalingPolicyState state, CustomResourceOptions options)resources:  _:    type: aws:emr:ManagedScalingPolicy    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- ClusterId string
- ID of the EMR cluster
- ComputeLimits List<ManagedScaling Policy Compute Limit> 
- Configuration block with compute limit settings. Described below.
- ClusterId string
- ID of the EMR cluster
- ComputeLimits []ManagedScaling Policy Compute Limit Args 
- Configuration block with compute limit settings. Described below.
- clusterId String
- ID of the EMR cluster
- computeLimits List<ManagedScaling Policy Compute Limit> 
- Configuration block with compute limit settings. Described below.
- clusterId string
- ID of the EMR cluster
- computeLimits ManagedScaling Policy Compute Limit[] 
- Configuration block with compute limit settings. Described below.
- cluster_id str
- ID of the EMR cluster
- compute_limits Sequence[ManagedScaling Policy Compute Limit Args] 
- Configuration block with compute limit settings. Described below.
- clusterId String
- ID of the EMR cluster
- computeLimits List<Property Map>
- Configuration block with compute limit settings. Described below.
Supporting Types
ManagedScalingPolicyComputeLimit, ManagedScalingPolicyComputeLimitArgs          
- MaximumCapacity intUnits 
- 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.
- MinimumCapacity intUnits 
- 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.
- UnitType string
- The unit type used for specifying a managed scaling policy. Valid Values: InstanceFleetUnits|Instances|VCPU
- MaximumCore intCapacity Units 
- 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.
- MaximumOndemand intCapacity Units 
- 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.
- MaximumCapacity intUnits 
- 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.
- MinimumCapacity intUnits 
- 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.
- UnitType string
- The unit type used for specifying a managed scaling policy. Valid Values: InstanceFleetUnits|Instances|VCPU
- MaximumCore intCapacity Units 
- 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.
- MaximumOndemand intCapacity Units 
- 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.
- maximumCapacity IntegerUnits 
- 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.
- minimumCapacity IntegerUnits 
- 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.
- unitType String
- The unit type used for specifying a managed scaling policy. Valid Values: InstanceFleetUnits|Instances|VCPU
- maximumCore IntegerCapacity Units 
- 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.
- maximumOndemand IntegerCapacity Units 
- 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.
- maximumCapacity numberUnits 
- 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.
- minimumCapacity numberUnits 
- 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.
- unitType string
- The unit type used for specifying a managed scaling policy. Valid Values: InstanceFleetUnits|Instances|VCPU
- maximumCore numberCapacity Units 
- 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.
- maximumOndemand numberCapacity Units 
- 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.
- maximum_capacity_ intunits 
- 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.
- minimum_capacity_ intunits 
- 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.
- unit_type str
- The unit type used for specifying a managed scaling policy. Valid Values: InstanceFleetUnits|Instances|VCPU
- maximum_core_ intcapacity_ units 
- 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.
- maximum_ondemand_ intcapacity_ units 
- 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.
- maximumCapacity NumberUnits 
- 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.
- minimumCapacity NumberUnits 
- 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.
- unitType String
- The unit type used for specifying a managed scaling policy. Valid Values: InstanceFleetUnits|Instances|VCPU
- maximumCore NumberCapacity Units 
- 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.
- maximumOndemand NumberCapacity Units 
- 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.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.