Class CfnLifecycleHookProps.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.CfnLifecycleHookProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLifecycleHookProps>
- Enclosing interface:
- CfnLifecycleHookProps
@Stability(Stable)
public static final class CfnLifecycleHookProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnLifecycleHookProps>
A builder for
CfnLifecycleHookProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionautoScalingGroupName
(String autoScalingGroupName) Sets the value ofCfnLifecycleHookProps.getAutoScalingGroupName()
build()
Builds the configured instance.defaultResult
(String defaultResult) Sets the value ofCfnLifecycleHookProps.getDefaultResult()
heartbeatTimeout
(Number heartbeatTimeout) Sets the value ofCfnLifecycleHookProps.getHeartbeatTimeout()
lifecycleHookName
(String lifecycleHookName) Sets the value ofCfnLifecycleHookProps.getLifecycleHookName()
lifecycleTransition
(String lifecycleTransition) Sets the value ofCfnLifecycleHookProps.getLifecycleTransition()
notificationMetadata
(String notificationMetadata) Sets the value ofCfnLifecycleHookProps.getNotificationMetadata()
notificationTargetArn
(String notificationTargetArn) Sets the value ofCfnLifecycleHookProps.getNotificationTargetArn()
Sets the value ofCfnLifecycleHookProps.getRoleArn()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
autoScalingGroupName
@Stability(Stable) public CfnLifecycleHookProps.Builder autoScalingGroupName(String autoScalingGroupName) Sets the value ofCfnLifecycleHookProps.getAutoScalingGroupName()
- Parameters:
autoScalingGroupName
- The name of the Auto Scaling group. This parameter is required.- Returns:
this
-
lifecycleTransition
@Stability(Stable) public CfnLifecycleHookProps.Builder lifecycleTransition(String lifecycleTransition) Sets the value ofCfnLifecycleHookProps.getLifecycleTransition()
- Parameters:
lifecycleTransition
- The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions. This parameter is required.- 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
.
- To create a lifecycle hook for scale-out events, specify
- Returns:
this
-
defaultResult
Sets the value ofCfnLifecycleHookProps.getDefaultResult()
- Parameters:
defaultResult
- The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value isABANDON
.Valid values:
CONTINUE
|ABANDON
- Returns:
this
-
heartbeatTimeout
Sets the value ofCfnLifecycleHookProps.getHeartbeatTimeout()
- Parameters:
heartbeatTimeout
- The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from30
to7200
seconds. The default value is3600
seconds (1 hour).- Returns:
this
-
lifecycleHookName
Sets the value ofCfnLifecycleHookProps.getLifecycleHookName()
- Parameters:
lifecycleHookName
- The name of the lifecycle hook.- Returns:
this
-
notificationMetadata
@Stability(Stable) public CfnLifecycleHookProps.Builder notificationMetadata(String notificationMetadata) Sets the value ofCfnLifecycleHookProps.getNotificationMetadata()
- Parameters:
notificationMetadata
- Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.- Returns:
this
-
notificationTargetArn
@Stability(Stable) public CfnLifecycleHookProps.Builder notificationTargetArn(String notificationTargetArn) Sets the value ofCfnLifecycleHookProps.getNotificationTargetArn()
- Parameters:
notificationTargetArn
- The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.- Returns:
this
-
roleArn
Sets the value ofCfnLifecycleHookProps.getRoleArn()
- Parameters:
roleArn
- The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. 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.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnLifecycleHookProps>
- Returns:
- a new instance of
CfnLifecycleHookProps
- Throws:
NullPointerException
- if any required attribute was not provided
-