public class LifecycleHook
extends java.lang.Object
implements java.io.Serializable
Describes a lifecycle hook, which tells Auto Scaling that you want to perform an action when an instance launches or terminates. When you have a lifecycle hook in place, the Auto Scaling group will either:
For more information, see Auto Scaling Lifecycle in the Auto Scaling Developer Guide.
Constructor and Description |
---|
LifecycleHook() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAutoScalingGroupName()
The name of the Auto Scaling group for the lifecycle hook.
|
java.lang.String |
getDefaultResult()
Defines the action the Auto Scaling group should take when the lifecycle
hook timeout elapses or if an unexpected failure occurs.
|
java.lang.Integer |
getGlobalTimeout()
The maximum time, in seconds, that an instance can remain in a
Pending:Wait or Terminating:Wait state. |
java.lang.Integer |
getHeartbeatTimeout()
The maximum time, in seconds, that can elapse before the lifecycle hook
times out.
|
java.lang.String |
getLifecycleHookName()
The name of the lifecycle hook.
|
java.lang.String |
getLifecycleTransition()
The state of the EC2 instance to which you want to attach the lifecycle
hook.
|
java.lang.String |
getNotificationMetadata()
Additional information that you want to include any time Auto Scaling
sends a message to the notification target.
|
java.lang.String |
getNotificationTargetARN()
The ARN of the notification target that Auto Scaling uses to notify you
when an instance is in the transition state for the lifecycle hook.
|
java.lang.String |
getRoleARN()
The ARN of the IAM role that allows the Auto Scaling group to publish to
the specified notification target.
|
int |
hashCode() |
void |
setAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group for the lifecycle hook.
|
void |
setDefaultResult(java.lang.String defaultResult)
Defines the action the Auto Scaling group should take when the lifecycle
hook timeout elapses or if an unexpected failure occurs.
|
void |
setGlobalTimeout(java.lang.Integer globalTimeout)
The maximum time, in seconds, that an instance can remain in a
Pending:Wait or Terminating:Wait state. |
void |
setHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
The maximum time, in seconds, that can elapse before the lifecycle hook
times out.
|
void |
setLifecycleHookName(java.lang.String lifecycleHookName)
The name of the lifecycle hook.
|
void |
setLifecycleTransition(java.lang.String lifecycleTransition)
The state of the EC2 instance to which you want to attach the lifecycle
hook.
|
void |
setNotificationMetadata(java.lang.String notificationMetadata)
Additional information that you want to include any time Auto Scaling
sends a message to the notification target.
|
void |
setNotificationTargetARN(java.lang.String notificationTargetARN)
The ARN of the notification target that Auto Scaling uses to notify you
when an instance is in the transition state for the lifecycle hook.
|
void |
setRoleARN(java.lang.String roleARN)
The ARN of the IAM role that allows the Auto Scaling group to publish to
the specified notification target.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
LifecycleHook |
withAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group for the lifecycle hook.
|
LifecycleHook |
withDefaultResult(java.lang.String defaultResult)
Defines the action the Auto Scaling group should take when the lifecycle
hook timeout elapses or if an unexpected failure occurs.
|
LifecycleHook |
withGlobalTimeout(java.lang.Integer globalTimeout)
The maximum time, in seconds, that an instance can remain in a
Pending:Wait or Terminating:Wait state. |
LifecycleHook |
withHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
The maximum time, in seconds, that can elapse before the lifecycle hook
times out.
|
LifecycleHook |
withLifecycleHookName(java.lang.String lifecycleHookName)
The name of the lifecycle hook.
|
LifecycleHook |
withLifecycleTransition(java.lang.String lifecycleTransition)
The state of the EC2 instance to which you want to attach the lifecycle
hook.
|
LifecycleHook |
withNotificationMetadata(java.lang.String notificationMetadata)
Additional information that you want to include any time Auto Scaling
sends a message to the notification target.
|
LifecycleHook |
withNotificationTargetARN(java.lang.String notificationTargetARN)
The ARN of the notification target that Auto Scaling uses to notify you
when an instance is in the transition state for the lifecycle hook.
|
LifecycleHook |
withRoleARN(java.lang.String roleARN)
The ARN of the IAM role that allows the Auto Scaling group to publish to
the specified notification target.
|
public java.lang.String getLifecycleHookName()
The name of the lifecycle hook.
Constraints:
Length: 1 - 255
Pattern: [A-Za-z0-9\-_\/]+
The name of the lifecycle hook.
public void setLifecycleHookName(java.lang.String lifecycleHookName)
The name of the lifecycle hook.
Constraints:
Length: 1 - 255
Pattern: [A-Za-z0-9\-_\/]+
lifecycleHookName
- The name of the lifecycle hook.
public LifecycleHook withLifecycleHookName(java.lang.String lifecycleHookName)
The name of the lifecycle hook.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 255
Pattern: [A-Za-z0-9\-_\/]+
lifecycleHookName
- The name of the lifecycle hook.
public java.lang.String getAutoScalingGroupName()
The name of the Auto Scaling group for the lifecycle hook.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
The name of the Auto Scaling group for the lifecycle hook.
public void setAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group for the lifecycle hook.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
autoScalingGroupName
- The name of the Auto Scaling group for the lifecycle hook.
public LifecycleHook withAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group for the lifecycle hook.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
autoScalingGroupName
- The name of the Auto Scaling group for the lifecycle hook.
public java.lang.String getLifecycleTransition()
The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.
The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.
public void setLifecycleTransition(java.lang.String lifecycleTransition)
The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.
lifecycleTransition
- The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.
public LifecycleHook withLifecycleTransition(java.lang.String lifecycleTransition)
The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.
Returns a reference to this object so that method calls can be chained together.
lifecycleTransition
- The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHookTypes.
public java.lang.String getNotificationTargetARN()
The ARN of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. The notification message sent to the target includes the following:
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
The ARN of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. The notification message sent to the target includes the following:
public void setNotificationTargetARN(java.lang.String notificationTargetARN)
The ARN of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. The notification message sent to the target includes the following:
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
notificationTargetARN
- The ARN of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. The notification message sent to the target includes the following:
public LifecycleHook withNotificationTargetARN(java.lang.String notificationTargetARN)
The ARN of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. The notification message sent to the target includes the following:
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
notificationTargetARN
- The ARN of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. The notification message sent to the target includes the following:
public java.lang.String getRoleARN()
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
public void setRoleARN(java.lang.String roleARN)
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
roleARN
- The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
public LifecycleHook withRoleARN(java.lang.String roleARN)
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
roleARN
- The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
public java.lang.String getNotificationMetadata()
Additional information that you want to include any time Auto Scaling sends a message to the notification target.
Constraints:
Length: 1 - 1023
Pattern: [ --�𐀀-\r\n\t]*
Additional information that you want to include any time Auto Scaling sends a message to the notification target.
public void setNotificationMetadata(java.lang.String notificationMetadata)
Additional information that you want to include any time Auto Scaling sends a message to the notification target.
Constraints:
Length: 1 - 1023
Pattern: [ --�𐀀-\r\n\t]*
notificationMetadata
- Additional information that you want to include any time Auto Scaling sends a message to the notification target.
public LifecycleHook withNotificationMetadata(java.lang.String notificationMetadata)
Additional information that you want to include any time Auto Scaling sends a message to the notification target.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1023
Pattern: [ --�𐀀-\r\n\t]*
notificationMetadata
- Additional information that you want to include any time Auto Scaling sends a message to the notification target.
public java.lang.Integer getHeartbeatTimeout()
The maximum time, in seconds, that can elapse before the lifecycle hook times out. The default is 3600 seconds (1 hour). When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
The maximum time, in seconds, that can elapse before the lifecycle hook times out. The default is 3600 seconds (1 hour). When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
public void setHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
The maximum time, in seconds, that can elapse before the lifecycle hook times out. The default is 3600 seconds (1 hour). When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
heartbeatTimeout
- The maximum time, in seconds, that can elapse before the lifecycle hook times out. The default is 3600 seconds (1 hour). When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
public LifecycleHook withHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
The maximum time, in seconds, that can elapse before the lifecycle hook times out. The default is 3600 seconds (1 hour). When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
Returns a reference to this object so that method calls can be chained together.
heartbeatTimeout
- The maximum time, in seconds, that can elapse before the lifecycle hook times out. The default is 3600 seconds (1 hour). When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
public java.lang.Integer getGlobalTimeout()
The maximum time, in seconds, that an instance can remain in a
Pending:Wait
or Terminating:Wait
state. The
default is 172800 seconds (48 hours).
The maximum time, in seconds, that an instance can remain in a
Pending:Wait
or Terminating:Wait
state.
The default is 172800 seconds (48 hours).
public void setGlobalTimeout(java.lang.Integer globalTimeout)
The maximum time, in seconds, that an instance can remain in a
Pending:Wait
or Terminating:Wait
state. The
default is 172800 seconds (48 hours).
globalTimeout
-
The maximum time, in seconds, that an instance can remain in a
Pending:Wait
or Terminating:Wait
state. The default is 172800 seconds (48 hours).
public LifecycleHook withGlobalTimeout(java.lang.Integer globalTimeout)
The maximum time, in seconds, that an instance can remain in a
Pending:Wait
or Terminating:Wait
state. The
default is 172800 seconds (48 hours).
Returns a reference to this object so that method calls can be chained together.
globalTimeout
-
The maximum time, in seconds, that an instance can remain in a
Pending:Wait
or Terminating:Wait
state. The default is 172800 seconds (48 hours).
public java.lang.String getDefaultResult()
Defines the action the Auto Scaling group should take when the lifecycle
hook timeout elapses or if an unexpected failure occurs. The valid values
are CONTINUE
and ABANDON
. The default value is
CONTINUE
.
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure
occurs. The valid values are CONTINUE
and
ABANDON
. The default value is CONTINUE
.
public void setDefaultResult(java.lang.String defaultResult)
Defines the action the Auto Scaling group should take when the lifecycle
hook timeout elapses or if an unexpected failure occurs. The valid values
are CONTINUE
and ABANDON
. The default value is
CONTINUE
.
defaultResult
-
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure
occurs. The valid values are CONTINUE
and
ABANDON
. The default value is
CONTINUE
.
public LifecycleHook withDefaultResult(java.lang.String defaultResult)
Defines the action the Auto Scaling group should take when the lifecycle
hook timeout elapses or if an unexpected failure occurs. The valid values
are CONTINUE
and ABANDON
. The default value is
CONTINUE
.
Returns a reference to this object so that method calls can be chained together.
defaultResult
-
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure
occurs. The valid values are CONTINUE
and
ABANDON
. The default value is
CONTINUE
.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.