ScalingTriggerProperty Struct
ScalingTrigger is a subproperty of the ScalingRule property type.
ScalingTrigger determines the conditions that trigger an automatic scaling activity.
| 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 scalingTriggerProperty: emr.CfnInstanceGroupConfig.ScalingTriggerProperty = {
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',
},
};
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
scaling_trigger_property = 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"
)
)
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.*;
ScalingTriggerProperty scalingTriggerProperty = 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();
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 scalingTriggerProperty = 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"
}
};
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"
scalingTriggerProperty := &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"),
},
}
Properties
cloudWatchAlarmDefinitionIResolvable | CfnInstanceGroupConfig.cloud_watch_alarm_definitiontyping.Union[IResolvable, CloudWatchAlarmDefinitionProperty]cloudWatchAlarmDefinitionIResolvableCloudWatchAlarmDefinitionIResolvableCloudWatchAlarmDefinitioninterface{} required #The definition of a CloudWatch metric alarm.
When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.