Class: AWSCDK::EMR::CfnCluster::AutoScalingPolicyProperty

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

Overview

AutoScalingPolicy is a subproperty of InstanceGroupConfig .

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 .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(constraints:, rules:) ⇒ AutoScalingPolicyProperty

Returns a new instance of AutoScalingPolicyProperty.

Parameters:



956
957
958
959
960
961
# File 'emr/cfn_cluster.rb', line 956

def initialize(constraints:, rules:)
  @constraints = constraints.is_a?(Hash) ? ::AWSCDK::EMR::CfnCluster::ScalingConstraintsProperty.new(**constraints.transform_keys(&:to_sym)) : constraints
  Jsii::Type.check_type(@constraints, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbXIuQ2ZuQ2x1c3Rlci5TY2FsaW5nQ29uc3RyYWludHNQcm9wZXJ0eSJ9XX19")), "constraints")
  @rules = rules
  Jsii::Type.check_type(@rules, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZW1yLkNmbkNsdXN0ZXIuU2NhbGluZ1J1bGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "rules")
end

Instance Attribute Details

#constraintsAWSCDK::IResolvable, AWSCDK::EMR::CfnCluster::ScalingConstraintsProperty (readonly)

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.



969
970
971
# File 'emr/cfn_cluster.rb', line 969

def constraints
  @constraints
end

#rulesAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::EMR::CfnCluster::ScalingRuleProperty> (readonly)

The scale-in and scale-out rules that comprise the automatic scaling policy.



974
975
976
# File 'emr/cfn_cluster.rb', line 974

def rules
  @rules
end

Class Method Details

.jsii_propertiesObject



976
977
978
979
980
981
# File 'emr/cfn_cluster.rb', line 976

def self.jsii_properties
  {
    :constraints => "constraints",
    :rules => "rules",
  }
end

Instance Method Details

#to_jsiiObject



983
984
985
986
987
988
989
990
# File 'emr/cfn_cluster.rb', line 983

def to_jsii
  result = {}
  result.merge!({
    "constraints" => @constraints,
    "rules" => @rules,
  })
  result.compact
end