aws-cdk-lib.aws_autoscaling.BasicLifecycleHookProps

interface BasicLifecycleHookProps

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

Basic 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 lifecycleHookTarget: autoscaling.ILifecycleHookTarget;
declare const role: iam.Role;
const basicLifecycleHookProps: autoscaling.BasicLifecycleHookProps = {
  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
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.

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.