LifecycleHookSpecificationProperty Struct
LifecycleHookSpecification specifies a lifecycle hook for the LifecycleHookSpecificationList property of the AWS::AutoScaling::AutoScalingGroup resource. A lifecycle hook specifies actions to perform when Amazon EC2 Auto Scaling launches or terminates instances.
For more information, see Amazon EC2 Auto Scaling lifecycle hooks in the Amazon EC2 Auto Scaling User Guide . You can find a sample template snippet in the Examples section of the AWS::AutoScaling::LifecycleHook resource.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
const lifecycleHookSpecificationProperty: autoscaling.CfnAutoScalingGroup.LifecycleHookSpecificationProperty = {
lifecycleHookName: 'lifecycleHookName',
lifecycleTransition: 'lifecycleTransition',
// the properties below are optional
defaultResult: 'defaultResult',
heartbeatTimeout: 123,
notificationMetadata: 'notificationMetadata',
notificationTargetArn: 'notificationTargetArn',
roleArn: 'roleArn',
};
Properties
The default value is ABANDON .
Valid values: CONTINUE | ABANDON
heartbeatTimeoutnumberheartbeat_timeoutint | floatheartbeatTimeoutNumberHeartbeatTimeoutdoubleHeartbeatTimeout*float64#The range is from 30 to 7200 seconds. The default value is 3600 seconds (1 hour).
lifecycleHookNamestringlifecycle_hook_namestrlifecycleHookNameStringLifecycleHookNamestringLifecycleHookName*stringrequired#lifecycleTransitionstringlifecycle_transitionstrlifecycleTransitionStringLifecycleTransitionstringLifecycleTransition*stringrequired#- To create a lifecycle hook for scale-out events, specify
autoscaling:EC2_INSTANCE_LAUNCHING. - To create a lifecycle hook for scale-in events, specify
autoscaling:EC2_INSTANCE_TERMINATING.
notificationMetadatastringnotification_metadatastrnotificationMetadataStringNotificationMetadatastringNotificationMetadata*string#notificationTargetArnstringnotification_target_arnstrnotificationTargetArnStringNotificationTargetArnstringNotificationTargetArn*string#You can specify an Amazon SNS topic or an Amazon SQS queue.
notes
For information about creating this role, see Prepare to add a lifecycle hook to your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide .
Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.