Class: AWSCDK::Autoscaling::LifecycleHookProps
- Inherits:
-
BasicLifecycleHookProps
- Object
- BasicLifecycleHookProps
- AWSCDK::Autoscaling::LifecycleHookProps
- Defined in:
- autoscaling/lifecycle_hook_props.rb
Overview
Properties for a Lifecycle hook.
Instance Attribute Summary collapse
-
#auto_scaling_group ⇒ AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef
readonly
The AutoScalingGroup to add the lifecycle hook to.
-
#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, auto_scaling_group:) ⇒ LifecycleHookProps
constructor
A new instance of LifecycleHookProps.
- #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, auto_scaling_group:) ⇒ LifecycleHookProps
Returns a new instance of LifecycleHookProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'autoscaling/lifecycle_hook_props.rb', line 15 def initialize(lifecycle_transition:, default_result: nil, heartbeat_timeout: nil, lifecycle_hook_name: nil, notification_metadata: nil, notification_target: nil, role: nil, auto_scaling_group:) @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? @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_group ⇒ AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef (readonly)
The AutoScalingGroup to add the lifecycle hook to.
73 74 75 |
# File 'autoscaling/lifecycle_hook_props.rb', line 73 def auto_scaling_group @auto_scaling_group end |
#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.
42 43 44 |
# File 'autoscaling/lifecycle_hook_props.rb', line 42 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.
49 50 51 |
# File 'autoscaling/lifecycle_hook_props.rb', line 49 def heartbeat_timeout @heartbeat_timeout end |
#lifecycle_hook_name ⇒ String? (readonly)
Default: - Automatically generated name.
Name of the lifecycle hook.
54 55 56 |
# File 'autoscaling/lifecycle_hook_props.rb', line 54 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.
37 38 39 |
# File 'autoscaling/lifecycle_hook_props.rb', line 37 def lifecycle_transition @lifecycle_transition end |
#notification_metadata ⇒ String? (readonly)
Default: - No metadata.
Additional data to pass to the lifecycle hook target.
59 60 61 |
# File 'autoscaling/lifecycle_hook_props.rb', line 59 def @notification_metadata end |
#notification_target ⇒ AWSCDK::Autoscaling::ILifecycleHookTarget? (readonly)
Default: - No target.
The target of the lifecycle hook.
64 65 66 |
# File 'autoscaling/lifecycle_hook_props.rb', line 64 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.
69 70 71 |
# File 'autoscaling/lifecycle_hook_props.rb', line 69 def role @role end |
Class Method Details
.jsii_properties ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'autoscaling/lifecycle_hook_props.rb', line 75 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", :auto_scaling_group => "autoScalingGroup", } end |
Instance Method Details
#to_jsii ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'autoscaling/lifecycle_hook_props.rb', line 88 def to_jsii result = {} result.merge!(super) result.merge!({ "lifecycleTransition" => @lifecycle_transition, "defaultResult" => @default_result, "heartbeatTimeout" => @heartbeat_timeout, "lifecycleHookName" => @lifecycle_hook_name, "notificationMetadata" => @notification_metadata, "notificationTarget" => @notification_target, "role" => @role, "autoScalingGroup" => @auto_scaling_group, }) result.compact end |