Class: AWSCDK::Autoscaling::Signals
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Autoscaling::Signals
- Defined in:
- autoscaling/signals.rb
Overview
Configure whether the AutoScalingGroup waits for signals.
If you do configure waiting for signals, you should make sure the instances
invoke cfn-signal somewhere in their UserData to signal that they have
started up (either successfully or unsuccessfully).
Signals are used both during intial creation and subsequent updates.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.wait_for_all(options = nil) ⇒ AWSCDK::Autoscaling::Signals
Wait for the desiredCapacity of the AutoScalingGroup amount of signals to have been received.
-
.wait_for_count(count, options = nil) ⇒ AWSCDK::Autoscaling::Signals
Wait for a specific amount of signals to have been received.
-
.wait_for_min_capacity(options = nil) ⇒ AWSCDK::Autoscaling::Signals
Wait for the minCapacity of the AutoScalingGroup amount of signals to have been received.
Instance Method Summary collapse
-
#do_render(options, count = nil) ⇒ AWSCDK::CfnCreationPolicy
Helper to render the actual creation policy, as the logic between them is quite similar.
-
#initialize ⇒ Signals
constructor
A new instance of Signals.
-
#render_creation_policy(render_options) ⇒ AWSCDK::CfnCreationPolicy
Render the ASG's CreationPolicy.
Constructor Details
#initialize ⇒ Signals
Returns a new instance of Signals.
14 15 16 |
# File 'autoscaling/signals.rb', line 14 def initialize Jsii::Object.instance_method(:initialize).bind(self).call end |
Class Method Details
.jsii_overridable_methods ⇒ Object
18 19 20 21 22 23 |
# File 'autoscaling/signals.rb', line 18 def self.jsii_overridable_methods { :do_render => { kind: :method, name: "doRender", is_optional: false }, :render_creation_policy => { kind: :method, name: "renderCreationPolicy", is_optional: false }, } end |
.wait_for_all(options = nil) ⇒ AWSCDK::Autoscaling::Signals
Wait for the desiredCapacity of the AutoScalingGroup amount of signals to have been received.
If no desiredCapacity has been configured, wait for minCapacity signals intead.
This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.
34 35 36 37 38 |
# File 'autoscaling/signals.rb', line 34 def self.wait_for_all( = nil) = .is_a?(Hash) ? ::AWSCDK::Autoscaling::SignalsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuU2lnbmFsc09wdGlvbnMifQ==")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_autoscaling.Signals", "waitForAll", []) end |
.wait_for_count(count, options = nil) ⇒ AWSCDK::Autoscaling::Signals
Wait for a specific amount of signals to have been received.
You should send one signal per instance, so this represents the number of instances to wait for.
This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.
51 52 53 54 55 56 |
# File 'autoscaling/signals.rb', line 51 def self.wait_for_count(count, = nil) Jsii::Type.check_type(count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "count") = .is_a?(Hash) ? ::AWSCDK::Autoscaling::SignalsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuU2lnbmFsc09wdGlvbnMifQ==")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_autoscaling.Signals", "waitForCount", [count, ]) end |
.wait_for_min_capacity(options = nil) ⇒ AWSCDK::Autoscaling::Signals
Wait for the minCapacity of the AutoScalingGroup amount of signals to have been received.
This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.
65 66 67 68 69 |
# File 'autoscaling/signals.rb', line 65 def self.wait_for_min_capacity( = nil) = .is_a?(Hash) ? ::AWSCDK::Autoscaling::SignalsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuU2lnbmFsc09wdGlvbnMifQ==")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_autoscaling.Signals", "waitForMinCapacity", []) end |
Instance Method Details
#do_render(options, count = nil) ⇒ AWSCDK::CfnCreationPolicy
Helper to render the actual creation policy, as the logic between them is quite similar.
76 77 78 79 80 81 |
# File 'autoscaling/signals.rb', line 76 def do_render(, count = nil) = .is_a?(Hash) ? ::AWSCDK::Autoscaling::SignalsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuU2lnbmFsc09wdGlvbnMifQ==")), "options") Jsii::Type.check_type(count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "count") unless count.nil? jsii_call_method("doRender", [, count]) end |
#render_creation_policy(render_options) ⇒ AWSCDK::CfnCreationPolicy
Render the ASG's CreationPolicy.
87 88 89 90 91 |
# File 'autoscaling/signals.rb', line 87 def render_creation_policy() = .is_a?(Hash) ? ::AWSCDK::Autoscaling::RenderSignalsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuUmVuZGVyU2lnbmFsc09wdGlvbnMifQ==")), "renderOptions") jsii_call_method("renderCreationPolicy", []) end |