Class: AWSCDK::AutoScalingHookTargets::FunctionHook
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::AutoScalingHookTargets::FunctionHook
- Includes:
- AWSCDK::Autoscaling::ILifecycleHookTarget
- Defined in:
- auto_scaling_hook_targets/function_hook.rb
Overview
Use a Lambda Function as a hook target.
Internally creates a Topic to make the connection.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(_scope, options) ⇒ AWSCDK::Autoscaling::LifecycleHookTargetConfig
If the
IRoledoes not exist inoptions, will create anIRoleand an SNS Topic and attach both to the lifecycle hook. -
#initialize(fn, encryption_key = nil) ⇒ FunctionHook
constructor
A new instance of FunctionHook.
Constructor Details
#initialize(fn, encryption_key = nil) ⇒ FunctionHook
Returns a new instance of FunctionHook.
13 14 15 16 17 |
# File 'auto_scaling_hook_targets/function_hook.rb', line 13 def initialize(fn, encryption_key = nil) Jsii::Type.check_type(fn, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "fn") Jsii::Type.check_type(encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionKey") unless encryption_key.nil? Jsii::Object.instance_method(:initialize).bind(self).call(fn, encryption_key) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
19 20 21 22 23 |
# File 'auto_scaling_hook_targets/function_hook.rb', line 19 def self.jsii_overridable_methods { :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind(_scope, options) ⇒ AWSCDK::Autoscaling::LifecycleHookTargetConfig
If the IRole does not exist in options, will create an IRole and an SNS Topic and attach both to the lifecycle hook.
If the IRole does exist in options, will only create an SNS Topic and attach it to the lifecycle hook.
32 33 34 35 36 37 |
# File 'auto_scaling_hook_targets/function_hook.rb', line 32 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 |