Class CfnLifecycleHookMixinProps.Builder
java.lang.Object
software.amazon.awscdk.cfnpropertymixins.services.autoscaling.CfnLifecycleHookMixinProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLifecycleHookMixinProps>
- Enclosing interface:
CfnLifecycleHookMixinProps
@Stability(Stable)
public static final class CfnLifecycleHookMixinProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnLifecycleHookMixinProps>
A builder for
CfnLifecycleHookMixinProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoScalingGroupName(String autoScalingGroupName) Sets the value ofCfnLifecycleHookMixinProps.getAutoScalingGroupName()autoScalingGroupName(IAutoScalingGroupRef autoScalingGroupName) Sets the value ofCfnLifecycleHookMixinProps.getAutoScalingGroupName()build()Builds the configured instance.defaultResult(String defaultResult) Sets the value ofCfnLifecycleHookMixinProps.getDefaultResult()heartbeatTimeout(Number heartbeatTimeout) Sets the value ofCfnLifecycleHookMixinProps.getHeartbeatTimeout()lifecycleHookName(String lifecycleHookName) Sets the value ofCfnLifecycleHookMixinProps.getLifecycleHookName()lifecycleTransition(String lifecycleTransition) Sets the value ofCfnLifecycleHookMixinProps.getLifecycleTransition()notificationMetadata(String notificationMetadata) Sets the value ofCfnLifecycleHookMixinProps.getNotificationMetadata()notificationTargetArn(String notificationTargetArn) Sets the value ofCfnLifecycleHookMixinProps.getNotificationTargetArn()notificationTargetArn(ITopicRef notificationTargetArn) Sets the value ofCfnLifecycleHookMixinProps.getNotificationTargetArn()notificationTargetArn(IQueueRef notificationTargetArn) Sets the value ofCfnLifecycleHookMixinProps.getNotificationTargetArn()Sets the value ofCfnLifecycleHookMixinProps.getRoleArn()Sets the value ofCfnLifecycleHookMixinProps.getRoleArn()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
autoScalingGroupName
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder autoScalingGroupName(String autoScalingGroupName) Sets the value ofCfnLifecycleHookMixinProps.getAutoScalingGroupName()- Parameters:
autoScalingGroupName- The name of the Auto Scaling group.- Returns:
this
-
autoScalingGroupName
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder autoScalingGroupName(IAutoScalingGroupRef autoScalingGroupName) Sets the value ofCfnLifecycleHookMixinProps.getAutoScalingGroupName()- Parameters:
autoScalingGroupName- The name of the Auto Scaling group.- Returns:
this
-
defaultResult
Sets the value ofCfnLifecycleHookMixinProps.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
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder heartbeatTimeout(Number heartbeatTimeout) Sets the value ofCfnLifecycleHookMixinProps.getHeartbeatTimeout()- Parameters:
heartbeatTimeout- The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from30to7200seconds. The default value is3600seconds (1 hour).- Returns:
this
-
lifecycleHookName
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder lifecycleHookName(String lifecycleHookName) Sets the value ofCfnLifecycleHookMixinProps.getLifecycleHookName()- Parameters:
lifecycleHookName- The name of the lifecycle hook.- Returns:
this
-
lifecycleTransition
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder lifecycleTransition(String lifecycleTransition) Sets the value ofCfnLifecycleHookMixinProps.getLifecycleTransition()- Parameters:
lifecycleTransition- The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.- 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
-
notificationMetadata
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder notificationMetadata(String notificationMetadata) Sets the value ofCfnLifecycleHookMixinProps.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 CfnLifecycleHookMixinProps.Builder notificationTargetArn(String notificationTargetArn) Sets the value ofCfnLifecycleHookMixinProps.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
-
notificationTargetArn
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder notificationTargetArn(ITopicRef notificationTargetArn) Sets the value ofCfnLifecycleHookMixinProps.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
-
notificationTargetArn
@Stability(Stable) public CfnLifecycleHookMixinProps.Builder notificationTargetArn(IQueueRef notificationTargetArn) Sets the value ofCfnLifecycleHookMixinProps.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 ofCfnLifecycleHookMixinProps.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
-
roleArn
Sets the value ofCfnLifecycleHookMixinProps.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:
buildin interfacesoftware.amazon.jsii.Builder<CfnLifecycleHookMixinProps>- Returns:
- a new instance of
CfnLifecycleHookMixinProps - Throws:
NullPointerException- if any required attribute was not provided
-