Class: AWSCDK::AutoScalingHookTargets::TopicHook
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::AutoScalingHookTargets::TopicHook
- Includes:
- AWSCDK::Autoscaling::ILifecycleHookTarget
- Defined in:
- auto_scaling_hook_targets/topic_hook.rb
Overview
Use an SNS topic as a hook target.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(_scope, options) ⇒ AWSCDK::Autoscaling::LifecycleHookTargetConfig
If an
IRoleis found inoptions, grant it topic publishing permissions. -
#initialize(topic) ⇒ TopicHook
constructor
A new instance of TopicHook.
Constructor Details
#initialize(topic) ⇒ TopicHook
Returns a new instance of TopicHook.
10 11 12 13 |
# File 'auto_scaling_hook_targets/topic_hook.rb', line 10 def initialize(topic) Jsii::Type.check_type(topic, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLklUb3BpYyJ9")), "topic") Jsii::Object.instance_method(:initialize).bind(self).call(topic) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
15 16 17 18 19 |
# File 'auto_scaling_hook_targets/topic_hook.rb', line 15 def self.jsii_overridable_methods { :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind(_scope, options) ⇒ AWSCDK::Autoscaling::LifecycleHookTargetConfig
If an IRole is found in options, grant it topic publishing permissions.
Otherwise, create a new IRole and grant it topic publishing permissions.
28 29 30 31 32 33 |
# File 'auto_scaling_hook_targets/topic_hook.rb', line 28 def bind(_scope, ) Jsii::Type.check_type(_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "_scope") = .is_a?(Hash) ? ::AWSCDK::Autoscaling::BindHookTargetOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQmluZEhvb2tUYXJnZXRPcHRpb25zIn0=")), "options") jsii_call_method("bind", [_scope, ]) end |