Class FunctionHook
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.autoscaling.hooktargets.FunctionHook
- All Implemented Interfaces:
ILifecycleHookTarget,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-20T23:37:15.164Z")
@Stability(Stable)
public class FunctionHook
extends software.amazon.jsii.JsiiObject
implements ILifecycleHookTarget
Use a Lambda Function as a hook target.
Internally creates a Topic to make the connection.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.autoscaling.hooktargets.*; import software.amazon.awscdk.services.kms.*; import software.amazon.awscdk.services.lambda.*; Function function_; Key key; FunctionHook functionHook = new FunctionHook(function_, key);
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.autoscaling.ILifecycleHookTarget
ILifecycleHookTarget.Jsii$Default, ILifecycleHookTarget.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionFunctionHook(IFunction fn, IKey encryptionKey) protectedFunctionHook(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedFunctionHook(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionbind(software.constructs.Construct _scope, BindHookTargetOptions options) If theIRoledoes not exist inoptions, will create anIRoleand an SNS Topic and attach both to the lifecycle hook.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
FunctionHook
protected FunctionHook(software.amazon.jsii.JsiiObjectRef objRef) -
FunctionHook
protected FunctionHook(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
FunctionHook
- Parameters:
fn- Function to invoke in response to a lifecycle event. This parameter is required.encryptionKey- If provided, this key is used to encrypt the contents of the SNS topic.
-
FunctionHook
- Parameters:
fn- Function to invoke in response to a lifecycle event. This parameter is required.
-
-
Method Details
-
bind
@Stability(Stable) @NotNull public LifecycleHookTargetConfig bind(@NotNull software.constructs.Construct _scope, @NotNull BindHookTargetOptions options) If theIRoledoes not exist inoptions, will create anIRoleand an SNS Topic and attach both to the lifecycle hook.If the
IRoledoes exist inoptions, will only create an SNS Topic and attach it to the lifecycle hook.- Specified by:
bindin interfaceILifecycleHookTarget- Parameters:
_scope- This parameter is required.options- This parameter is required.
-