Class: AWSCDK::Autoscaling::WarmPoolProps

Inherits:
WarmPoolOptions
  • Object
show all
Defined in:
autoscaling/warm_pool_props.rb

Overview

Properties for a warm pool.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_group_prepared_capacity: nil, min_size: nil, pool_state: nil, reuse_on_scale_in: nil, auto_scaling_group:) ⇒ WarmPoolProps

Returns a new instance of WarmPoolProps.

Parameters:

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

    The maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.

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

    The minimum number of instances to maintain in the warm pool.

  • pool_state (AWSCDK::Autoscaling::PoolState, nil) (defaults to: nil)

    The instance state to transition to after the lifecycle actions are complete.

  • reuse_on_scale_in (Boolean, nil) (defaults to: nil)

    Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.

  • auto_scaling_group (AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef)

    The Auto Scaling group to add the warm pool to.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'autoscaling/warm_pool_props.rb', line 12

def initialize(max_group_prepared_capacity: nil, min_size: nil, pool_state: nil, reuse_on_scale_in: nil, auto_scaling_group:)
  @max_group_prepared_capacity = max_group_prepared_capacity
  Jsii::Type.check_type(@max_group_prepared_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxGroupPreparedCapacity") unless @max_group_prepared_capacity.nil?
  @min_size = min_size
  Jsii::Type.check_type(@min_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minSize") unless @min_size.nil?
  @pool_state = pool_state
  Jsii::Type.check_type(@pool_state, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuUG9vbFN0YXRlIn0=")), "poolState") unless @pool_state.nil?
  @reuse_on_scale_in = reuse_on_scale_in
  Jsii::Type.check_type(@reuse_on_scale_in, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "reuseOnScaleIn") unless @reuse_on_scale_in.nil?
  @auto_scaling_group = auto_scaling_group
  Jsii::Type.check_type(@auto_scaling_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hdXRvc2NhbGluZy5JQXV0b1NjYWxpbmdHcm91cFJlZiJ9")), "autoScalingGroup")
end

Instance Attribute Details

#auto_scaling_groupAWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef (readonly)

The Auto Scaling group to add the warm pool to.



54
55
56
# File 'autoscaling/warm_pool_props.rb', line 54

def auto_scaling_group
  @auto_scaling_group
end

#max_group_prepared_capacityNumeric? (readonly)

Note:

Default: - max size of the Auto Scaling group

The maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.

If the value is not specified, Amazon EC2 Auto Scaling launches and maintains the difference between the group's maximum capacity and its desired capacity.

Returns:

  • (Numeric, nil)


32
33
34
# File 'autoscaling/warm_pool_props.rb', line 32

def max_group_prepared_capacity
  @max_group_prepared_capacity
end

#min_sizeNumeric? (readonly)

Note:

Default: 0

The minimum number of instances to maintain in the warm pool.

Returns:

  • (Numeric, nil)


37
38
39
# File 'autoscaling/warm_pool_props.rb', line 37

def min_size
  @min_size
end

#pool_stateAWSCDK::Autoscaling::PoolState? (readonly)

Note:

Default: PoolState.STOPPED

The instance state to transition to after the lifecycle actions are complete.



42
43
44
# File 'autoscaling/warm_pool_props.rb', line 42

def pool_state
  @pool_state
end

#reuse_on_scale_inBoolean? (readonly)

Note:

Default: false

Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.

If the value is not specified, instances in the Auto Scaling group will be terminated when the group scales in.

Returns:

  • (Boolean, nil)


50
51
52
# File 'autoscaling/warm_pool_props.rb', line 50

def reuse_on_scale_in
  @reuse_on_scale_in
end

Class Method Details

.jsii_propertiesObject



56
57
58
59
60
61
62
63
64
# File 'autoscaling/warm_pool_props.rb', line 56

def self.jsii_properties
  {
    :max_group_prepared_capacity => "maxGroupPreparedCapacity",
    :min_size => "minSize",
    :pool_state => "poolState",
    :reuse_on_scale_in => "reuseOnScaleIn",
    :auto_scaling_group => "autoScalingGroup",
  }
end

Instance Method Details

#to_jsiiObject



66
67
68
69
70
71
72
73
74
75
76
77
# File 'autoscaling/warm_pool_props.rb', line 66

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "maxGroupPreparedCapacity" => @max_group_prepared_capacity,
    "minSize" => @min_size,
    "poolState" => @pool_state,
    "reuseOnScaleIn" => @reuse_on_scale_in,
    "autoScalingGroup" => @auto_scaling_group,
  })
  result.compact
end