Class: AWSCDK::EMR::CfnInstanceGroupConfig::CloudWatchAlarmDefinitionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
emr/cfn_instance_group_config.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::CfnInstanceGroupConfig::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.



691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'emr/cfn_instance_group_config.rb', line 691

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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZW1yLkNmbkluc3RhbmNlR3JvdXBDb25maWcuTWV0cmljRGltZW5zaW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "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 .



716
717
718
# File 'emr/cfn_instance_group_config.rb', line 716

def comparison_operator
  @comparison_operator
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 .



745
746
747
# File 'emr/cfn_instance_group_config.rb', line 745

def evaluation_periods
  @evaluation_periods
end

#metric_nameString (readonly)

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



721
722
723
# File 'emr/cfn_instance_group_config.rb', line 721

def metric_name
  @metric_name
end

#namespaceString? (readonly)

The namespace for the CloudWatch metric.

The default is AWS/ElasticMapReduce .



752
753
754
# File 'emr/cfn_instance_group_config.rb', line 752

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 .



728
729
730
# File 'emr/cfn_instance_group_config.rb', line 728

def period
  @period
end

#statisticString? (readonly)

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

The default is AVERAGE .



759
760
761
# File 'emr/cfn_instance_group_config.rb', line 759

def statistic
  @statistic
end

#thresholdNumeric (readonly)

The value against which the specified statistic is compared.



733
734
735
# File 'emr/cfn_instance_group_config.rb', line 733

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.



766
767
768
# File 'emr/cfn_instance_group_config.rb', line 766

def unit
  @unit
end

Class Method Details

.jsii_propertiesObject



768
769
770
771
772
773
774
775
776
777
778
779
780
# File 'emr/cfn_instance_group_config.rb', line 768

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



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'emr/cfn_instance_group_config.rb', line 782

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