Class LifecycleHook.Builder

java.lang.Object
software.amazon.awscdk.services.autoscaling.LifecycleHook.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<LifecycleHook>
Enclosing class:
LifecycleHook

@Stability(Stable) public static final class LifecycleHook.Builder extends Object implements software.amazon.jsii.Builder<LifecycleHook>
A fluent builder for LifecycleHook.
  • Method Details

    • create

      @Stability(Stable) public static LifecycleHook.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of LifecycleHook.Builder.
    • lifecycleTransition

      @Stability(Stable) public LifecycleHook.Builder lifecycleTransition(LifecycleTransition lifecycleTransition)
      The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.

      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 LifecycleHook.Builder defaultResult(DefaultResult defaultResult)
      The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.

      Default: Continue

      Parameters:
      defaultResult - The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. This parameter is required.
      Returns:
      this
    • heartbeatTimeout

      @Stability(Stable) public LifecycleHook.Builder heartbeatTimeout(Duration heartbeatTimeout)
      Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.

      If the lifecycle hook times out, perform the action in DefaultResult.

      Default: - No heartbeat timeout.

      Parameters:
      heartbeatTimeout - Maximum time between calls to RecordLifecycleActionHeartbeat for the hook. This parameter is required.
      Returns:
      this
    • lifecycleHookName

      @Stability(Stable) public LifecycleHook.Builder lifecycleHookName(String lifecycleHookName)
      Name of the lifecycle hook.

      Default: - Automatically generated name.

      Parameters:
      lifecycleHookName - Name of the lifecycle hook. This parameter is required.
      Returns:
      this
    • notificationMetadata

      @Stability(Stable) public LifecycleHook.Builder notificationMetadata(String notificationMetadata)
      Additional data to pass to the lifecycle hook target.

      Default: - No metadata.

      Parameters:
      notificationMetadata - Additional data to pass to the lifecycle hook target. This parameter is required.
      Returns:
      this
    • notificationTarget

      @Stability(Stable) public LifecycleHook.Builder notificationTarget(ILifecycleHookTarget notificationTarget)
      The target of the lifecycle hook.

      Default: - No target.

      Parameters:
      notificationTarget - The target of the lifecycle hook. This parameter is required.
      Returns:
      this
    • role

      @Stability(Stable) public LifecycleHook.Builder role(IRole role)
      The role that allows publishing to the notification target.

      Default: - A role will be created if a target is provided. Otherwise, no role is created.

      Parameters:
      role - The role that allows publishing to the notification target. This parameter is required.
      Returns:
      this
    • autoScalingGroup

      @Stability(Stable) public LifecycleHook.Builder autoScalingGroup(IAutoScalingGroup autoScalingGroup)
      The AutoScalingGroup to add the lifecycle hook to.

      Parameters:
      autoScalingGroup - The AutoScalingGroup to add the lifecycle hook to. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public LifecycleHook build()
      Specified by:
      build in interface software.amazon.jsii.Builder<LifecycleHook>
      Returns:
      a newly built instance of LifecycleHook.