Class: AWSCDK::EMR::CfnCluster::CloudWatchAlarmDefinitionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
emr/cfn_cluster.rb

Overview

CloudWatchAlarmDefinition is a subproperty of the ScalingTrigger property, which determines when to trigger an automatic scaling activity.

Scaling activity begins when you satisfy the defined alarm conditions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comparison_operator:, metric_name:, period:, threshold:, dimensions: nil, evaluation_periods: nil, namespace: nil, statistic: nil, unit: nil) ⇒ CloudWatchAlarmDefinitionProperty

Returns a new instance of CloudWatchAlarmDefinitionProperty.

Parameters:

  • comparison_operator (String)

    Determines how the metric specified by MetricName is compared to the value specified by Threshold .

  • metric_name (String)

    The name of the CloudWatch metric that is watched to determine an alarm condition.

  • period (Numeric)

    The period, in seconds, over which the statistic is applied.

  • threshold (Numeric)

    The value against which the specified statistic is compared.

  • dimensions (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::EMR::CfnCluster::MetricDimensionProperty>, nil) (defaults to: nil)

    A CloudWatch metric dimension.

  • evaluation_periods (Numeric, nil) (defaults to: nil)

    The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity.

  • namespace (String, nil) (defaults to: nil)

    The namespace for the CloudWatch metric.

  • statistic (String, nil) (defaults to: nil)

    The statistic to apply to the metric associated with the alarm.

  • unit (String, nil) (defaults to: nil)

    The unit of measure associated with the CloudWatch metric being watched.



1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
# File 'emr/cfn_cluster.rb', line 1092

def initialize(comparison_operator:, metric_name:, period:, threshold:, dimensions: nil, evaluation_periods: nil, namespace: nil, statistic: nil, unit: nil)
  @comparison_operator = comparison_operator
  Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comparisonOperator")
  @metric_name = metric_name
  Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  @period = period
  Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "period")
  @threshold = threshold
  Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold")
  @dimensions = dimensions
  Jsii::Type.check_type(@dimensions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZW1yLkNmbkNsdXN0ZXIuTWV0cmljRGltZW5zaW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "dimensions") unless @dimensions.nil?
  @evaluation_periods = evaluation_periods
  Jsii::Type.check_type(@evaluation_periods, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "evaluationPeriods") unless @evaluation_periods.nil?
  @namespace = namespace
  Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") unless @namespace.nil?
  @statistic = statistic
  Jsii::Type.check_type(@statistic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statistic") unless @statistic.nil?
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit") unless @unit.nil?
end

Instance Attribute Details

#comparison_operatorString (readonly)

Determines how the metric specified by MetricName is compared to the value specified by Threshold .



1117
1118
1119
# File 'emr/cfn_cluster.rb', line 1117

def comparison_operator
  @comparison_operator
end

#dimensionsAWSCDK::IResolvable, ... (readonly)

A CloudWatch metric dimension.



1139
1140
1141
# File 'emr/cfn_cluster.rb', line 1139

def dimensions
  @dimensions
end

#evaluation_periodsNumeric? (readonly)

The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity.

The default value is 1 .



1146
1147
1148
# File 'emr/cfn_cluster.rb', line 1146

def evaluation_periods
  @evaluation_periods
end

#metric_nameString (readonly)

The name of the CloudWatch metric that is watched to determine an alarm condition.



1122
1123
1124
# File 'emr/cfn_cluster.rb', line 1122

def metric_name
  @metric_name
end

#namespaceString? (readonly)

The namespace for the CloudWatch metric.

The default is AWS/ElasticMapReduce .



1153
1154
1155
# File 'emr/cfn_cluster.rb', line 1153

def namespace
  @namespace
end

#periodNumeric (readonly)

The period, in seconds, over which the statistic is applied.

CloudWatch metrics for Amazon EMR are emitted every five minutes (300 seconds), so if you specify a CloudWatch metric, specify 300 .



1129
1130
1131
# File 'emr/cfn_cluster.rb', line 1129

def period
  @period
end

#statisticString? (readonly)

The statistic to apply to the metric associated with the alarm.

The default is AVERAGE .



1160
1161
1162
# File 'emr/cfn_cluster.rb', line 1160

def statistic
  @statistic
end

#thresholdNumeric (readonly)

The value against which the specified statistic is compared.



1134
1135
1136
# File 'emr/cfn_cluster.rb', line 1134

def threshold
  @threshold
end

#unitString? (readonly)

The unit of measure associated with the CloudWatch metric being watched.

The value specified for Unit must correspond to the units specified in the CloudWatch metric.



1167
1168
1169
# File 'emr/cfn_cluster.rb', line 1167

def unit
  @unit
end

Class Method Details

.jsii_propertiesObject



1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
# File 'emr/cfn_cluster.rb', line 1169

def self.jsii_properties
  {
    :comparison_operator => "comparisonOperator",
    :metric_name => "metricName",
    :period => "period",
    :threshold => "threshold",
    :dimensions => "dimensions",
    :evaluation_periods => "evaluationPeriods",
    :namespace => "namespace",
    :statistic => "statistic",
    :unit => "unit",
  }
end

Instance Method Details

#to_jsiiObject



1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
# File 'emr/cfn_cluster.rb', line 1183

def to_jsii
  result = {}
  result.merge!({
    "comparisonOperator" => @comparison_operator,
    "metricName" => @metric_name,
    "period" => @period,
    "threshold" => @threshold,
    "dimensions" => @dimensions,
    "evaluationPeriods" => @evaluation_periods,
    "namespace" => @namespace,
    "statistic" => @statistic,
    "unit" => @unit,
  })
  result.compact
end