Class LifecycleHookProps.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.LifecycleHookProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<LifecycleHookProps>
- Enclosing interface:
- LifecycleHookProps
@Stability(Stable)
public static final class LifecycleHookProps.Builder
extends Object
implements software.amazon.jsii.Builder<LifecycleHookProps>
A builder for
LifecycleHookProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoScalingGroup(IAutoScalingGroup autoScalingGroup) Sets the value ofLifecycleHookProps.getAutoScalingGroup()build()Builds the configured instance.defaultResult(DefaultResult defaultResult) Sets the value ofBasicLifecycleHookProps.getDefaultResult()heartbeatTimeout(Duration heartbeatTimeout) Sets the value ofBasicLifecycleHookProps.getHeartbeatTimeout()lifecycleHookName(String lifecycleHookName) Sets the value ofBasicLifecycleHookProps.getLifecycleHookName()lifecycleTransition(LifecycleTransition lifecycleTransition) Sets the value ofBasicLifecycleHookProps.getLifecycleTransition()notificationMetadata(String notificationMetadata) Sets the value ofBasicLifecycleHookProps.getNotificationMetadata()notificationTarget(ILifecycleHookTarget notificationTarget) Sets the value ofBasicLifecycleHookProps.getNotificationTarget()Sets the value ofBasicLifecycleHookProps.getRole()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
autoScalingGroup
@Stability(Stable) public LifecycleHookProps.Builder autoScalingGroup(IAutoScalingGroup autoScalingGroup) Sets the value ofLifecycleHookProps.getAutoScalingGroup()- Parameters:
autoScalingGroup- The AutoScalingGroup to add the lifecycle hook to. This parameter is required.- Returns:
this
-
lifecycleTransition
@Stability(Stable) public LifecycleHookProps.Builder lifecycleTransition(LifecycleTransition lifecycleTransition) Sets the value ofBasicLifecycleHookProps.getLifecycleTransition()- Parameters:
lifecycleTransition- The state of the Amazon EC2 instance to which you want to attach the lifecycle hook. This parameter is required.- Returns:
this
-
defaultResult
Sets the value ofBasicLifecycleHookProps.getDefaultResult()- Parameters:
defaultResult- The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.- Returns:
this
-
heartbeatTimeout
Sets the value ofBasicLifecycleHookProps.getHeartbeatTimeout()- Parameters:
heartbeatTimeout- Maximum time between calls to RecordLifecycleActionHeartbeat for the hook. If the lifecycle hook times out, perform the action in DefaultResult.- Returns:
this
-
lifecycleHookName
Sets the value ofBasicLifecycleHookProps.getLifecycleHookName()- Parameters:
lifecycleHookName- Name of the lifecycle hook.- Returns:
this
-
notificationMetadata
@Stability(Stable) public LifecycleHookProps.Builder notificationMetadata(String notificationMetadata) Sets the value ofBasicLifecycleHookProps.getNotificationMetadata()- Parameters:
notificationMetadata- Additional data to pass to the lifecycle hook target.- Returns:
this
-
notificationTarget
@Stability(Stable) public LifecycleHookProps.Builder notificationTarget(ILifecycleHookTarget notificationTarget) Sets the value ofBasicLifecycleHookProps.getNotificationTarget()- Parameters:
notificationTarget- The target of the lifecycle hook.- Returns:
this
-
role
Sets the value ofBasicLifecycleHookProps.getRole()- Parameters:
role- The role that allows publishing to the notification target.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<LifecycleHookProps>- Returns:
- a new instance of
LifecycleHookProps - Throws:
NullPointerException- if any required attribute was not provided
-