AutoScalingPolicyProperty Struct
AutoScalingPolicy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric.
For more information, see Using Automatic Scaling in Amazon EMR in the Amazon EMR Management Guide .
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_emr as emr } from 'aws-cdk-lib';
const autoScalingPolicyProperty: emr.CfnInstanceGroupConfig.AutoScalingPolicyProperty = {
constraints: {
maxCapacity: 123,
minCapacity: 123,
},
rules: [{
action: {
simpleScalingPolicyConfiguration: {
scalingAdjustment: 123,
// the properties below are optional
adjustmentType: 'adjustmentType',
coolDown: 123,
},
// the properties below are optional
market: 'market',
},
name: 'name',
trigger: {
cloudWatchAlarmDefinition: {
comparisonOperator: 'comparisonOperator',
metricName: 'metricName',
period: 123,
threshold: 123,
// the properties below are optional
dimensions: [{
key: 'key',
value: 'value',
}],
evaluationPeriods: 123,
namespace: 'namespace',
statistic: 'statistic',
unit: 'unit',
},
},
// the properties below are optional
description: 'description',
}],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_emr as emr
auto_scaling_policy_property = emr.CfnInstanceGroupConfig.AutoScalingPolicyProperty(
constraints=emr.CfnInstanceGroupConfig.ScalingConstraintsProperty(
max_capacity=123,
min_capacity=123
),
rules=[emr.CfnInstanceGroupConfig.ScalingRuleProperty(
action=emr.CfnInstanceGroupConfig.ScalingActionProperty(
simple_scaling_policy_configuration=emr.CfnInstanceGroupConfig.SimpleScalingPolicyConfigurationProperty(
scaling_adjustment=123,
# the properties below are optional
adjustment_type="adjustmentType",
cool_down=123
),
# the properties below are optional
market="market"
),
name="name",
trigger=emr.CfnInstanceGroupConfig.ScalingTriggerProperty(
cloud_watch_alarm_definition=emr.CfnInstanceGroupConfig.CloudWatchAlarmDefinitionProperty(
comparison_operator="comparisonOperator",
metric_name="metricName",
period=123,
threshold=123,
# the properties below are optional
dimensions=[emr.CfnInstanceGroupConfig.MetricDimensionProperty(
key="key",
value="value"
)],
evaluation_periods=123,
namespace="namespace",
statistic="statistic",
unit="unit"
)
),
# the properties below are optional
description="description"
)]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.emr.*;
AutoScalingPolicyProperty autoScalingPolicyProperty = AutoScalingPolicyProperty.builder()
.constraints(ScalingConstraintsProperty.builder()
.maxCapacity(123)
.minCapacity(123)
.build())
.rules(List.of(ScalingRuleProperty.builder()
.action(ScalingActionProperty.builder()
.simpleScalingPolicyConfiguration(SimpleScalingPolicyConfigurationProperty.builder()
.scalingAdjustment(123)
// the properties below are optional
.adjustmentType("adjustmentType")
.coolDown(123)
.build())
// the properties below are optional
.market("market")
.build())
.name("name")
.trigger(ScalingTriggerProperty.builder()
.cloudWatchAlarmDefinition(CloudWatchAlarmDefinitionProperty.builder()
.comparisonOperator("comparisonOperator")
.metricName("metricName")
.period(123)
.threshold(123)
// the properties below are optional
.dimensions(List.of(MetricDimensionProperty.builder()
.key("key")
.value("value")
.build()))
.evaluationPeriods(123)
.namespace("namespace")
.statistic("statistic")
.unit("unit")
.build())
.build())
// the properties below are optional
.description("description")
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EMR;
var autoScalingPolicyProperty = new AutoScalingPolicyProperty {
Constraints = new ScalingConstraintsProperty {
MaxCapacity = 123,
MinCapacity = 123
},
Rules = new [] { new ScalingRuleProperty {
Action = new ScalingActionProperty {
SimpleScalingPolicyConfiguration = new SimpleScalingPolicyConfigurationProperty {
ScalingAdjustment = 123,
// the properties below are optional
AdjustmentType = "adjustmentType",
CoolDown = 123
},
// the properties below are optional
Market = "market"
},
Name = "name",
Trigger = new ScalingTriggerProperty {
CloudWatchAlarmDefinition = new CloudWatchAlarmDefinitionProperty {
ComparisonOperator = "comparisonOperator",
MetricName = "metricName",
Period = 123,
Threshold = 123,
// the properties below are optional
Dimensions = new [] { new MetricDimensionProperty {
Key = "key",
Value = "value"
} },
EvaluationPeriods = 123,
Namespace = "namespace",
Statistic = "statistic",
Unit = "unit"
}
},
// the properties below are optional
Description = "description"
} }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
autoScalingPolicyProperty := &AutoScalingPolicyProperty{
Constraints: &ScalingConstraintsProperty{
MaxCapacity: jsii.Number(123),
MinCapacity: jsii.Number(123),
},
Rules: []interface{}{
&ScalingRuleProperty{
Action: &ScalingActionProperty{
SimpleScalingPolicyConfiguration: &SimpleScalingPolicyConfigurationProperty{
ScalingAdjustment: jsii.Number(123),
// the properties below are optional
AdjustmentType: jsii.String("adjustmentType"),
CoolDown: jsii.Number(123),
},
// the properties below are optional
Market: jsii.String("market"),
},
Name: jsii.String("name"),
Trigger: &ScalingTriggerProperty{
CloudWatchAlarmDefinition: &CloudWatchAlarmDefinitionProperty{
ComparisonOperator: jsii.String("comparisonOperator"),
MetricName: jsii.String("metricName"),
Period: jsii.Number(123),
Threshold: jsii.Number(123),
// the properties below are optional
Dimensions: []interface{}{
&MetricDimensionProperty{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
EvaluationPeriods: jsii.Number(123),
Namespace: jsii.String("namespace"),
Statistic: jsii.String("statistic"),
Unit: jsii.String("unit"),
},
},
// the properties below are optional
Description: jsii.String("description"),
},
},
}
Properties
constraintsIResolvable | CfnInstanceGroupConfig.constraintstyping.Union[IResolvable, ScalingConstraintsProperty]constraintsIResolvableConstraintsIResolvableConstraintsinterface{} required #The upper and lower Amazon EC2 instance limits for an automatic scaling policy.
Automatic scaling activity will not cause an instance group to grow above or below these limits.
rulesIResolvable | IResolvable | CfnInstanceGroupConfig.rulestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ScalingRuleProperty]]]rulesIResolvableRulesIResolvableRulesinterface{} required #The scale-in and scale-out rules that comprise the automatic scaling policy.