Class CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnAutoScalingGroup.LifecycleHookSpecificationProperty>
- Enclosing interface:
CfnAutoScalingGroup.LifecycleHookSpecificationProperty
@Stability(Stable)
public static final class CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnAutoScalingGroup.LifecycleHookSpecificationProperty>
A builder for
CfnAutoScalingGroup.LifecycleHookSpecificationProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.defaultResult
(String defaultResult) heartbeatTimeout
(Number heartbeatTimeout) lifecycleHookName
(String lifecycleHookName) lifecycleTransition
(String lifecycleTransition) notificationMetadata
(String notificationMetadata) notificationTargetArn
(String notificationTargetArn) Sets the value ofCfnAutoScalingGroup.LifecycleHookSpecificationProperty.getRoleArn()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
lifecycleHookName
@Stability(Stable) public CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder lifecycleHookName(String lifecycleHookName) - Parameters:
lifecycleHookName
- The name of the lifecycle hook. This parameter is required.- Returns:
this
-
lifecycleTransition
@Stability(Stable) public CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder lifecycleTransition(String lifecycleTransition) - 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
@Stability(Stable) public CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder defaultResult(String defaultResult) - 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 CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder heartbeatTimeout(Number heartbeatTimeout) - 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
-
notificationMetadata
@Stability(Stable) public CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder notificationMetadata(String notificationMetadata) - 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 CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder notificationTargetArn(String notificationTargetArn) - 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
@Stability(Stable) public CfnAutoScalingGroup.LifecycleHookSpecificationProperty.Builder roleArn(String roleArn) Sets the value ofCfnAutoScalingGroup.LifecycleHookSpecificationProperty.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 Configure a notification target for a lifecycle hook 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<CfnAutoScalingGroup.LifecycleHookSpecificationProperty>
- Returns:
- a new instance of
CfnAutoScalingGroup.LifecycleHookSpecificationProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-