# LifecycleHookProps

Properties for a Lifecycle hook.

Extends: LifecycleHookProps
Extends: BasicLifecycleHookProps
Used as props by: LifecycleHook

- Source: [`aws-autoscaling/lib/lifecycle-hook.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-autoscaling/lib/lifecycle-hook.ts#L69)
- Type last changed: v2.234.0 · 8 Jan 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_autoscaling as interfaces_autoscaling } from 'aws-cdk-lib/interfaces';

declare const autoScalingGroupRef: interfaces_autoscaling.IAutoScalingGroupRef;
declare const lifecycleHookTarget: autoscaling.ILifecycleHookTarget;
declare const role: iam.Role;
const lifecycleHookProps: autoscaling.LifecycleHookProps = {
  autoScalingGroup: autoScalingGroupRef,
  lifecycleTransition: autoscaling.LifecycleTransition.INSTANCE_LAUNCHING,

  // the properties below are optional
  defaultResult: autoscaling.DefaultResult.CONTINUE,
  heartbeatTimeout: cdk.Duration.minutes(30),
  lifecycleHookName: 'lifecycleHookName',
  notificationMetadata: 'notificationMetadata',
  notificationTarget: lifecycleHookTarget,
  role: role,
};
```

## Properties

- `autoScalingGroup`: [IAutoScalingGroupRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_autoscaling.IAutoScalingGroupRef.html) (required) — The AutoScalingGroup to add the lifecycle hook to.

- `defaultResult`: [DefaultResult](/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.DefaultResult.html) = Continue — The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.

- `heartbeatTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.

  **Default:** No heartbeat timeout.

  If the lifecycle hook times out, perform the action in DefaultResult.

- `lifecycleHookName`: string — Name of the lifecycle hook.

  **Default:** Automatically generated name.

- `lifecycleTransition`: [LifecycleTransition](/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.LifecycleTransition.html) (required) — The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.

- `notificationMetadata`: string — Additional data to pass to the lifecycle hook target.

  **Default:** No metadata.

- `notificationTarget`: [ILifecycleHookTarget](/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.ILifecycleHookTarget.html) — The target of the lifecycle hook.

  **Default:** No target.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The role that allows publishing to the notification target.

  **Default:** A role will be created if a target is provided. Otherwise, no role is created.
