Class: AWSCDK::Autoscaling::BasicLifecycleHookProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Autoscaling::BasicLifecycleHookProps
- Defined in:
- autoscaling/basic_lifecycle_hook_props.rb
Overview
Basic properties for a lifecycle hook.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#default_result ⇒ AWSCDK::Autoscaling::DefaultResult?
readonly
The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.
-
#heartbeat_timeout ⇒ AWSCDK::Duration?
readonly
Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.
-
#lifecycle_hook_name ⇒ String?
readonly
Name of the lifecycle hook.
-
#lifecycle_transition ⇒ AWSCDK::Autoscaling::LifecycleTransition
readonly
The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.
-
#notification_metadata ⇒ String?
readonly
Additional data to pass to the lifecycle hook target.
-
#notification_target ⇒ AWSCDK::Autoscaling::ILifecycleHookTarget?
readonly
The target of the lifecycle hook.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
The role that allows publishing to the notification target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(lifecycle_transition:, default_result: nil, heartbeat_timeout: nil, lifecycle_hook_name: nil, notification_metadata: nil, notification_target: nil, role: nil) ⇒ BasicLifecycleHookProps
constructor
A new instance of BasicLifecycleHookProps.
- #to_jsii ⇒ Object
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.
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_result ⇒ AWSCDK::Autoscaling::DefaultResult? (readonly)
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_timeout ⇒ AWSCDK::Duration? (readonly)
Default: - No heartbeat timeout.
Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.
If the lifecycle hook times out, perform the action in DefaultResult.
46 47 48 |
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 46 def heartbeat_timeout @heartbeat_timeout end |
#lifecycle_hook_name ⇒ String? (readonly)
Default: - Automatically generated name.
Name of the lifecycle hook.
51 52 53 |
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 51 def lifecycle_hook_name @lifecycle_hook_name end |
#lifecycle_transition ⇒ AWSCDK::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_metadata ⇒ String? (readonly)
Default: - No metadata.
Additional data to pass to the lifecycle hook target.
56 57 58 |
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 56 def @notification_metadata end |
#notification_target ⇒ AWSCDK::Autoscaling::ILifecycleHookTarget? (readonly)
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 |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
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.
66 67 68 |
# File 'autoscaling/basic_lifecycle_hook_props.rb', line 66 def role @role end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |