1. Packages
  2. AWS Classic
  3. API Docs
  4. emr
  5. ManagedScalingPolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

aws.emr.ManagedScalingPolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

    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=aws.emr.ClusterMasterInstanceGroupArgs(
            instance_type="m4.large",
        ),
        core_instance_group=aws.emr.ClusterCoreInstanceGroupArgs(
            instance_type="c4.large",
        ))
    samplepolicy = aws.emr.ManagedScalingPolicy("samplepolicy",
        cluster_id=sample.id,
        compute_limits=[aws.emr.ManagedScalingPolicyComputeLimitArgs(
            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

    new ManagedScalingPolicy(name: string, args: ManagedScalingPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ManagedScalingPolicy(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             cluster_id: Optional[str] = None,
                             compute_limits: Optional[Sequence[ManagedScalingPolicyComputeLimitArgs]] = None)
    @overload
    def ManagedScalingPolicy(resource_name: str,
                             args: ManagedScalingPolicyArgs,
                             opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    The ManagedScalingPolicy resource accepts the following input properties:

    ClusterId string
    ID of the EMR cluster
    ComputeLimits List<ManagedScalingPolicyComputeLimit>
    Configuration block with compute limit settings. Described below.
    ClusterId string
    ID of the EMR cluster
    ComputeLimits []ManagedScalingPolicyComputeLimitArgs
    Configuration block with compute limit settings. Described below.
    clusterId String
    ID of the EMR cluster
    computeLimits List<ManagedScalingPolicyComputeLimit>
    Configuration block with compute limit settings. Described below.
    clusterId string
    ID of the EMR cluster
    computeLimits ManagedScalingPolicyComputeLimit[]
    Configuration block with compute limit settings. Described below.
    cluster_id str
    ID of the EMR cluster
    compute_limits Sequence[ManagedScalingPolicyComputeLimitArgs]
    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) -> ManagedScalingPolicy
    func 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)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    ClusterId string
    ID of the EMR cluster
    ComputeLimits List<ManagedScalingPolicyComputeLimit>
    Configuration block with compute limit settings. Described below.
    ClusterId string
    ID of the EMR cluster
    ComputeLimits []ManagedScalingPolicyComputeLimitArgs
    Configuration block with compute limit settings. Described below.
    clusterId String
    ID of the EMR cluster
    computeLimits List<ManagedScalingPolicyComputeLimit>
    Configuration block with compute limit settings. Described below.
    clusterId string
    ID of the EMR cluster
    computeLimits ManagedScalingPolicyComputeLimit[]
    Configuration block with compute limit settings. Described below.
    cluster_id str
    ID of the EMR cluster
    compute_limits Sequence[ManagedScalingPolicyComputeLimitArgs]
    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

    MaximumCapacityUnits int
    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.
    MinimumCapacityUnits int
    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
    MaximumCoreCapacityUnits int
    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.
    MaximumOndemandCapacityUnits int
    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.
    MaximumCapacityUnits int
    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.
    MinimumCapacityUnits int
    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
    MaximumCoreCapacityUnits int
    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.
    MaximumOndemandCapacityUnits int
    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.
    maximumCapacityUnits Integer
    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.
    minimumCapacityUnits Integer
    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
    maximumCoreCapacityUnits Integer
    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.
    maximumOndemandCapacityUnits Integer
    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.
    maximumCapacityUnits number
    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.
    minimumCapacityUnits number
    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
    maximumCoreCapacityUnits number
    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.
    maximumOndemandCapacityUnits number
    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_units int
    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_units int
    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_capacity_units int
    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_capacity_units int
    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.
    maximumCapacityUnits Number
    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.
    minimumCapacityUnits Number
    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
    maximumCoreCapacityUnits Number
    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.
    maximumOndemandCapacityUnits Number
    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
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi