Class BasicLifecycleHookProps.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.BasicLifecycleHookProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BasicLifecycleHookProps>
- Enclosing interface:
BasicLifecycleHookProps
@Stability(Stable)
public static final class BasicLifecycleHookProps.Builder
extends Object
implements software.amazon.jsii.Builder<BasicLifecycleHookProps>
A builder for
BasicLifecycleHookProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
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
-
lifecycleTransition
@Stability(Stable) public BasicLifecycleHookProps.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
@Stability(Stable) public BasicLifecycleHookProps.Builder defaultResult(DefaultResult 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
@Stability(Stable) public BasicLifecycleHookProps.Builder heartbeatTimeout(Duration 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
@Stability(Stable) public BasicLifecycleHookProps.Builder lifecycleHookName(String lifecycleHookName) Sets the value ofBasicLifecycleHookProps.getLifecycleHookName()
- Parameters:
lifecycleHookName
- Name of the lifecycle hook.- Returns:
this
-
notificationMetadata
@Stability(Stable) public BasicLifecycleHookProps.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 BasicLifecycleHookProps.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:
build
in interfacesoftware.amazon.jsii.Builder<BasicLifecycleHookProps>
- Returns:
- a new instance of
BasicLifecycleHookProps
- Throws:
NullPointerException
- if any required attribute was not provided
-