Class: AWSCDK::EMR::CfnInstanceGroupConfig::ScalingRuleProperty

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

Overview

ScalingRule is a subproperty of the AutoScalingPolicy property type.

ScalingRule defines the scale-in or scale-out rules for scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, name:, trigger:, description: nil) ⇒ ScalingRuleProperty

Returns a new instance of ScalingRuleProperty.

Parameters:



1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'emr/cfn_instance_group_config.rb', line 1099

def initialize(action:, name:, trigger:, description: nil)
  @action = action.is_a?(Hash) ? ::AWSCDK::EMR::CfnInstanceGroupConfig::ScalingActionProperty.new(**action.transform_keys(&:to_sym)) : action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbXIuQ2ZuSW5zdGFuY2VHcm91cENvbmZpZy5TY2FsaW5nQWN0aW9uUHJvcGVydHkifV19fQ==")), "action")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @trigger = trigger.is_a?(Hash) ? ::AWSCDK::EMR::CfnInstanceGroupConfig::ScalingTriggerProperty.new(**trigger.transform_keys(&:to_sym)) : trigger
  Jsii::Type.check_type(@trigger, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbXIuQ2ZuSW5zdGFuY2VHcm91cENvbmZpZy5TY2FsaW5nVHJpZ2dlclByb3BlcnR5In1dfX0=")), "trigger")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

A friendly, more verbose description of the automatic scaling rule.



1131
1132
1133
# File 'emr/cfn_instance_group_config.rb', line 1131

def description
  @description
end

#nameString (readonly)

The name used to identify an automatic scaling rule.

Rule names must be unique within a scaling policy.



1121
1122
1123
# File 'emr/cfn_instance_group_config.rb', line 1121

def name
  @name
end

#triggerAWSCDK::IResolvable, AWSCDK::EMR::CfnInstanceGroupConfig::ScalingTriggerProperty (readonly)

The CloudWatch alarm definition that determines when automatic scaling activity is triggered.



1126
1127
1128
# File 'emr/cfn_instance_group_config.rb', line 1126

def trigger
  @trigger
end

Class Method Details

.jsii_propertiesObject



1133
1134
1135
1136
1137
1138
1139
1140
# File 'emr/cfn_instance_group_config.rb', line 1133

def self.jsii_properties
  {
    :action => "action",
    :name => "name",
    :trigger => "trigger",
    :description => "description",
  }
end

Instance Method Details

#to_jsiiObject



1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
# File 'emr/cfn_instance_group_config.rb', line 1142

def to_jsii
  result = {}
  result.merge!({
    "action" => @action,
    "name" => @name,
    "trigger" => @trigger,
    "description" => @description,
  })
  result.compact
end