Class: AWSCDK::Autoscaling::RetentionTriggers

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

Overview

Defines the specific triggers that cause instances to be retained in a Retained state rather than terminated.

Each trigger corresponds to a different failure scenario during the instance lifecycle. This allows fine-grained control over when to preserve instances for manual intervention.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(terminate_hook_abandon: nil) ⇒ RetentionTriggers

Returns a new instance of RetentionTriggers.

Parameters:

  • terminate_hook_abandon (AWSCDK::Autoscaling::TerminateHookAbandonAction, nil) (defaults to: nil)

    Specifies the action when a termination lifecycle hook is abandoned due to failure, timeout, or explicit abandonment (calling CompleteLifecycleAction).



12
13
14
15
# File 'autoscaling/retention_triggers.rb', line 12

def initialize(terminate_hook_abandon: nil)
  @terminate_hook_abandon = terminate_hook_abandon
  Jsii::Type.check_type(@terminate_hook_abandon, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuVGVybWluYXRlSG9va0FiYW5kb25BY3Rpb24ifQ==")), "terminateHookAbandon") unless @terminate_hook_abandon.nil?
end

Instance Attribute Details

#terminate_hook_abandonAWSCDK::Autoscaling::TerminateHookAbandonAction? (readonly)

Note:

Default: - No action specified

Specifies the action when a termination lifecycle hook is abandoned due to failure, timeout, or explicit abandonment (calling CompleteLifecycleAction).

Set to Retain to move instances to a Retained state. Set to Terminate for default termination behavior.

Retained instances don't count toward desired capacity and remain until you call TerminateInstanceInAutoScalingGroup.



26
27
28
# File 'autoscaling/retention_triggers.rb', line 26

def terminate_hook_abandon
  @terminate_hook_abandon
end

Class Method Details

.jsii_propertiesObject



28
29
30
31
32
# File 'autoscaling/retention_triggers.rb', line 28

def self.jsii_properties
  {
    :terminate_hook_abandon => "terminateHookAbandon",
  }
end

Instance Method Details

#to_jsiiObject



34
35
36
37
38
39
40
# File 'autoscaling/retention_triggers.rb', line 34

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