Define a life cycle hook.
import { LifecycleHook } from 'aws-cdk-lib/aws-autoscaling';Or use the module namespace:
import * as autoscaling from 'aws-cdk-lib/aws-autoscaling';
// autoscaling.LifecycleHookConfiguration passed to the constructor as LifecycleHookProps.
autoScalingGroupRequiredIAutoScalingGroupRefThe AutoScalingGroup to add the lifecycle hook to.
BasicLifecycleHookPropslifecycleTransitionRequiredinherited from BasicLifecycleHookPropsLifecycleTransitionThe state of the Amazon EC2 instance to which you want to attach the lifecycle hook.
defaultResultOptionalinherited from BasicLifecycleHookPropsDefaultResultThe action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.
Default: Continue
heartbeatTimeoutOptionalinherited from BasicLifecycleHookPropsDurationMaximum time between calls to RecordLifecycleActionHeartbeat for the hook. If the lifecycle hook times out, perform the action in DefaultResult.
Default: - No heartbeat timeout.
lifecycleHookNameOptionalinherited from BasicLifecycleHookPropsstringName of the lifecycle hook.
Default: - Automatically generated name.
notificationMetadataOptionalinherited from BasicLifecycleHookPropsstringAdditional data to pass to the lifecycle hook target.
Default: - No metadata.
notificationTargetOptionalinherited from BasicLifecycleHookPropsILifecycleHookTargetThe target of the lifecycle hook.
Default: - No target.
roleOptionalinherited from BasicLifecycleHookPropsIRoleThe role that allows publishing to the notification target.
Default: - A role will be created if a target is provided. Otherwise, no role is created.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-autoscaling