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=[{
"maximumCapacityUnits": 0,
"minimumCapacityUnits": 0,
"unitType": "string",
"maximumCoreCapacityUnits": 0,
"maximumOndemandCapacityUnits": 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
The ManagedScalingPolicy resource accepts the following input properties:
- Cluster
Id string - ID of the EMR cluster
- Compute
Limits List<ManagedScaling Policy Compute Limit> - Configuration block with compute limit settings. Described below.
- Cluster
Id string - ID of the EMR cluster
- Compute
Limits []ManagedScaling Policy Compute Limit Args - Configuration block with compute limit settings. Described below.
- cluster
Id String - ID of the EMR cluster
- compute
Limits List<ManagedScaling Policy Compute Limit> - Configuration block with compute limit settings. Described below.
- cluster
Id string - ID of the EMR cluster
- compute
Limits 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.
- cluster
Id String - ID of the EMR cluster
- compute
Limits 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.
- Cluster
Id string - ID of the EMR cluster
- Compute
Limits List<ManagedScaling Policy Compute Limit> - Configuration block with compute limit settings. Described below.
- Cluster
Id string - ID of the EMR cluster
- Compute
Limits []ManagedScaling Policy Compute Limit Args - Configuration block with compute limit settings. Described below.
- cluster
Id String - ID of the EMR cluster
- compute
Limits List<ManagedScaling Policy Compute Limit> - Configuration block with compute limit settings. Described below.
- cluster
Id string - ID of the EMR cluster
- compute
Limits 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.
- cluster
Id String - ID of the EMR cluster
- compute
Limits List<Property Map> - Configuration block with compute limit settings. Described below.
Supporting Types
ManagedScalingPolicyComputeLimit, ManagedScalingPolicyComputeLimitArgs
- 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 string - 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.
- 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 string - 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.
- maximum
Capacity 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.
- minimum
Capacity 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.
- unit
Type String - The unit type used for specifying a managed scaling policy. Valid Values:
InstanceFleetUnits
|Instances
|VCPU
- maximum
Core 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.
- maximum
Ondemand 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.
- maximum
Capacity 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.
- minimum
Capacity 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.
- unit
Type string - The unit type used for specifying a managed scaling policy. Valid Values:
InstanceFleetUnits
|Instances
|VCPU
- maximum
Core 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.
- maximum
Ondemand 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.
- maximum
Capacity 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.
- minimum
Capacity 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.
- unit
Type String - The unit type used for specifying a managed scaling policy. Valid Values:
InstanceFleetUnits
|Instances
|VCPU
- maximum
Core 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.
- maximum
Ondemand 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
aws
Terraform Provider.