aws-cdk-lib.aws_autoscaling.LifecycleHookProps

interface LifecycleHookProps

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.LifecycleHookProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#LifecycleHookProps
Javasoftware.amazon.awscdk.services.autoscaling.LifecycleHookProps
Pythonaws_cdk.aws_autoscaling.LifecycleHookProps
TypeScript (source)aws-cdk-lib » aws_autoscaling » LifecycleHookProps

Properties for a Lifecycle hook.

Example

// 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';

declare const autoScalingGroup: autoscaling.AutoScalingGroup;
declare const lifecycleHookTarget: autoscaling.ILifecycleHookTarget;
declare const role: iam.Role;
const lifecycleHookProps: autoscaling.LifecycleHookProps = {
  autoScalingGroup: autoScalingGroup,
  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

NameTypeDescription
autoScalingGroupIAutoScalingGroupThe AutoScalingGroup to add the lifecycle hook to.
lifecycleTransitionLifecycleTransitionThe state of the Amazon EC2 instance to which you want to attach the lifecycle hook.
defaultResult?DefaultResultThe action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.
heartbeatTimeout?DurationMaximum time between calls to RecordLifecycleActionHeartbeat for the hook.
lifecycleHookName?stringName of the lifecycle hook.
notificationMetadata?stringAdditional data to pass to the lifecycle hook target.
notificationTarget?ILifecycleHookTargetThe target of the lifecycle hook.
role?IRoleThe role that allows publishing to the notification target.

autoScalingGroup

Type: IAutoScalingGroup

The AutoScalingGroup to add the lifecycle hook to.


lifecycleTransition

Type: LifecycleTransition

The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.


defaultResult?

Type: DefaultResult (optional, default: Continue)

The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.


heartbeatTimeout?

Type: Duration (optional, default: No heartbeat timeout.)

Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.

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


lifecycleHookName?

Type: string (optional, default: Automatically generated name.)

Name of the lifecycle hook.


notificationMetadata?

Type: string (optional, default: No metadata.)

Additional data to pass to the lifecycle hook target.


notificationTarget?

Type: ILifecycleHookTarget (optional, default: No target.)

The target of the lifecycle hook.


role?

Type: IRole (optional, default: A role will be created if a target is provided. Otherwise, no role is created.)

The role that allows publishing to the notification target.