Class: AWSCDK::Autoscaling::BasicLifecycleHookProps

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

Overview

Basic properties for a lifecycle hook.

Direct Known Subclasses

LifecycleHookProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lifecycle_transition:, default_result: nil, heartbeat_timeout: nil, lifecycle_hook_name: nil, notification_metadata: nil, notification_target: nil, role: nil) ⇒ BasicLifecycleHookProps

Returns a new instance of BasicLifecycleHookProps.

Parameters:

  • lifecycle_transition (AWSCDK::Autoscaling::LifecycleTransition)

    The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.

  • default_result (AWSCDK::Autoscaling::DefaultResult, nil) (defaults to: nil)

    The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.

  • heartbeat_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.

  • lifecycle_hook_name (String, nil) (defaults to: nil)

    Name of the lifecycle hook.

  • notification_metadata (String, nil) (defaults to: nil)

    Additional data to pass to the lifecycle hook target.

  • notification_target (AWSCDK::Autoscaling::ILifecycleHookTarget, nil) (defaults to: nil)

    The target of the lifecycle hook.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The role that allows publishing to the notification target.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 14

def initialize(lifecycle_transition:, default_result: nil, heartbeat_timeout: nil, lifecycle_hook_name: nil, notification_metadata: nil, notification_target: nil, role: nil)
  @lifecycle_transition = lifecycle_transition
  Jsii::Type.check_type(@lifecycle_transition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuTGlmZWN5Y2xlVHJhbnNpdGlvbiJ9")), "lifecycleTransition")
  @default_result = default_result
  Jsii::Type.check_type(@default_result, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuRGVmYXVsdFJlc3VsdCJ9")), "defaultResult") unless @default_result.nil?
  @heartbeat_timeout = heartbeat_timeout
  Jsii::Type.check_type(@heartbeat_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "heartbeatTimeout") unless @heartbeat_timeout.nil?
  @lifecycle_hook_name = lifecycle_hook_name
  Jsii::Type.check_type(@lifecycle_hook_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "lifecycleHookName") unless @lifecycle_hook_name.nil?
  @notification_metadata = 
  Jsii::Type.check_type(@notification_metadata, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "notificationMetadata") unless @notification_metadata.nil?
  @notification_target = notification_target
  Jsii::Type.check_type(@notification_target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuSUxpZmVjeWNsZUhvb2tUYXJnZXQifQ==")), "notificationTarget") unless @notification_target.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
end

Instance Attribute Details

#default_resultAWSCDK::Autoscaling::DefaultResult? (readonly)

Note:

Default: Continue

The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.



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

def default_result
  @default_result
end

#heartbeat_timeoutAWSCDK::Duration? (readonly)

Note:

Default: - No heartbeat timeout.

Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.

If the lifecycle hook times out, perform the action in DefaultResult.

Returns:



46
47
48
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 46

def heartbeat_timeout
  @heartbeat_timeout
end

#lifecycle_hook_nameString? (readonly)

Note:

Default: - Automatically generated name.

Name of the lifecycle hook.

Returns:

  • (String, nil)


51
52
53
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 51

def lifecycle_hook_name
  @lifecycle_hook_name
end

#lifecycle_transitionAWSCDK::Autoscaling::LifecycleTransition (readonly)

The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.



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

def lifecycle_transition
  @lifecycle_transition
end

#notification_metadataString? (readonly)

Note:

Default: - No metadata.

Additional data to pass to the lifecycle hook target.

Returns:

  • (String, nil)


56
57
58
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 56

def 
  @notification_metadata
end

#notification_targetAWSCDK::Autoscaling::ILifecycleHookTarget? (readonly)

Note:

Default: - No target.

The target of the lifecycle hook.



61
62
63
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 61

def notification_target
  @notification_target
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A role will be created if a target is provided. Otherwise, no role is created.

The role that allows publishing to the notification target.

Returns:



66
67
68
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 66

def role
  @role
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
78
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 68

def self.jsii_properties
  {
    :lifecycle_transition => "lifecycleTransition",
    :default_result => "defaultResult",
    :heartbeat_timeout => "heartbeatTimeout",
    :lifecycle_hook_name => "lifecycleHookName",
    :notification_metadata => "notificationMetadata",
    :notification_target => "notificationTarget",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 80

def to_jsii
  result = {}
  result.merge!({
    "lifecycleTransition" => @lifecycle_transition,
    "defaultResult" => @default_result,
    "heartbeatTimeout" => @heartbeat_timeout,
    "lifecycleHookName" => @lifecycle_hook_name,
    "notificationMetadata" => @notification_metadata,
    "notificationTarget" => @notification_target,
    "role" => @role,
  })
  result.compact
end