Class: AWSCDK::Autoscaling::WarmPoolOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
autoscaling/warm_pool_options.rb

Overview

Options for a warm pool.

Direct Known Subclasses

WarmPoolProps

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) ⇒ WarmPoolOptions

Returns a new instance of WarmPoolOptions.

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.



11
12
13
14
15
16
17
18
19
20
# File 'autoscaling/warm_pool_options.rb', line 11

def initialize(max_group_prepared_capacity: nil, min_size: nil, pool_state: nil, reuse_on_scale_in: nil)
  @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?
end

Instance Attribute Details

#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)


29
30
31
# File 'autoscaling/warm_pool_options.rb', line 29

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)


34
35
36
# File 'autoscaling/warm_pool_options.rb', line 34

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.



39
40
41
# File 'autoscaling/warm_pool_options.rb', line 39

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)


47
48
49
# File 'autoscaling/warm_pool_options.rb', line 47

def reuse_on_scale_in
  @reuse_on_scale_in
end

Class Method Details

.jsii_propertiesObject



49
50
51
52
53
54
55
56
# File 'autoscaling/warm_pool_options.rb', line 49

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

Instance Method Details

#to_jsiiObject



58
59
60
61
62
63
64
65
66
67
# File 'autoscaling/warm_pool_options.rb', line 58

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