Skip to content

LifecycleHookProps

Properties for defining a LifecycleHook.

See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-ess-lifecyclehook

Initializer

import com.aliyun.ros.cdk.ess.LifecycleHookProps;
LifecycleHookProps.builder()
    .lifecycleTransition(java.lang.String)
    .lifecycleTransition(IResolvable)
    .scalingGroupId(java.lang.String)
    .scalingGroupId(IResolvable)
//  .defaultResult(java.lang.String)
//  .defaultResult(IResolvable)
//  .heartbeatTimeout(java.lang.Number)
//  .heartbeatTimeout(IResolvable)
//  .lifecycleHookName(java.lang.String)
//  .lifecycleHookName(IResolvable)
//  .notificationArn(java.lang.String)
//  .notificationArn(IResolvable)
//  .notificationMetadata(java.lang.String)
//  .notificationMetadata(IResolvable)
    .build();

Properties

Name Type Description
lifecycleTransition java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property lifecycleTransition: The scaling activities to which lifecycle hooks apply Value range: SCALE_OUT: scale-out event SCALE_IN: scale-in event.
scalingGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property scalingGroupId: The ID of the scaling group.
defaultResult java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property defaultResult: The action that the scaling group takes when the lifecycle hook times out.
heartbeatTimeout java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property heartbeatTimeout: The time, in seconds, that can elapse before the lifecycle hook times out.
lifecycleHookName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property lifecycleHookName: The name of the lifecycle hook.
notificationArn java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property notificationArn: The Alibaba Cloud Resource Name (ARN) of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook.
notificationMetadata java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property notificationMetadata: The fixed string that you want to include when Auto Scaling sends a message about the wait state of the scaling activity to the notification target.

lifecycleTransitionRequired

public java.lang.Object getLifecycleTransition();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property lifecycleTransition: The scaling activities to which lifecycle hooks apply Value range: SCALE_OUT: scale-out event SCALE_IN: scale-in event.


scalingGroupIdRequired

public java.lang.Object getScalingGroupId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property scalingGroupId: The ID of the scaling group.


defaultResultOptional

public java.lang.Object getDefaultResult();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property defaultResult: The action that the scaling group takes when the lifecycle hook times out.

Value range: CONTINUE: the scaling group continues with the scale-in or scale-out process. ABANDON: the scaling group stops any remaining action of the scale-in or scale-out event. Default value: CONTINUE If the scaling group has multiple lifecycle hooks and one of them is terminated by the DefaultResult=ABANDON parameter during a scale-in event (SCALE_IN), the remaining lifecycle hooks under the same scaling group will also be terminated. Otherwise, the action following the wait state is the next action, as specified in the parameter DefaultResult, after the last lifecycle event under the same scaling group.


heartbeatTimeoutOptional

public java.lang.Object getHeartbeatTimeout();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property heartbeatTimeout: The time, in seconds, that can elapse before the lifecycle hook times out.

If the lifecycle hook times out, the scaling group performs the default action (DefaultResult). The range is from 30 to 86400 seconds. The default value is 600 seconds. You can prevent the lifecycle hook from timing out by calling the RecordLifecycleActionHeartbeat operation. You can also terminate the lifecycle action by calling the CompleteLifecycleAction operation.


lifecycleHookNameOptional

public java.lang.Object getLifecycleHookName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property lifecycleHookName: The name of the lifecycle hook.

Each name must be unique within a scaling group. The name must be 2 to 64 characters in length and can contain letters, numbers, Chinese characters, and special characters including underscores (_), hyphens (-) and periods (.). Default value: Lifecycle Hook ID


notificationArnOptional

public java.lang.Object getNotificationArn();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property notificationArn: The Alibaba Cloud Resource Name (ARN) of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook.

This target can be either an MNS queue or an MNS topic. The format of the parameter value is acs:ess:{region}:{account-id}:{resource-relative-id}. region: the region to which the scaling group locates account-id: Alibaba Cloud ID For example: MNS queue: acs:ess:{region}:{account-id}:queue/{queuename} MNS topic: acs:ess:{region}:{account-id}:topic/{topicname} OOS template: acs:ess:{region}:{account-id}:oos/{templatename}


notificationMetadataOptional

public java.lang.Object getNotificationMetadata();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property notificationMetadata: The fixed string that you want to include when Auto Scaling sends a message about the wait state of the scaling activity to the notification target.

The length of the parameter can be up to 4096 characters. Auto Scaling will send the specified NotificationMetadata parameter along with the notification message so that you can easily categorize your notifications. The NotificationMetadata parameter will only take effect after you specify the NotificationArn parameter.