public class PutLifecycleHookRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
PutLifecycleHook operation
.
Creates or updates a lifecycle hook for the specified Auto Scaling Group.
A lifecycle hook tells Auto Scaling that you want to perform an action on an instance that is not actively in service; for example, either when the instance launches or before the instance terminates.
This operation is a part of the basic sequence for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide .
If you exceed your maximum limit of lifecycle hooks, which by default is 50 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference .
NOOP
Constructor and Description |
---|
PutLifecycleHookRequest() |
Modifier and Type | Method and Description |
---|---|
PutLifecycleHookRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
String |
getAutoScalingGroupName()
The name of the Auto Scaling group to which you want to assign the
lifecycle hook.
|
String |
getDefaultResult()
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure occurs.
|
Integer |
getHeartbeatTimeout()
Defines the amount of time, in seconds, that can elapse before the
lifecycle hook times out.
|
String |
getLifecycleHookName()
The name of the lifecycle hook.
|
String |
getLifecycleTransition()
The instance state to which you want to attach the lifecycle hook.
|
String |
getNotificationMetadata()
Contains additional information that you want to include any time Auto
Scaling sends a message to the notification target.
|
String |
getNotificationTargetARN()
The ARN of the notification target that Auto Scaling will use to
notify you when an instance is in the transition state for the
lifecycle hook.
|
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(String autoScalingGroupName)
The name of the Auto Scaling group to which you want to assign the
lifecycle hook.
|
void |
setDefaultResult(String defaultResult)
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure occurs.
|
void |
setHeartbeatTimeout(Integer heartbeatTimeout)
Defines the amount of time, in seconds, that can elapse before the
lifecycle hook times out.
|
void |
setLifecycleHookName(String lifecycleHookName)
The name of the lifecycle hook.
|
void |
setLifecycleTransition(String lifecycleTransition)
The instance state to which you want to attach the lifecycle hook.
|
void |
setNotificationMetadata(String notificationMetadata)
Contains additional information that you want to include any time Auto
Scaling sends a message to the notification target.
|
void |
setNotificationTargetARN(String notificationTargetARN)
The ARN of the notification target that Auto Scaling will use to
notify you when an instance is in the transition state for the
lifecycle hook.
|
void |
setRoleARN(String roleARN)
The ARN of the IAM role that allows the Auto Scaling group to publish
to the specified notification target.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
PutLifecycleHookRequest |
withAutoScalingGroupName(String autoScalingGroupName)
The name of the Auto Scaling group to which you want to assign the
lifecycle hook.
|
PutLifecycleHookRequest |
withDefaultResult(String defaultResult)
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure occurs.
|
PutLifecycleHookRequest |
withHeartbeatTimeout(Integer heartbeatTimeout)
Defines the amount of time, in seconds, that can elapse before the
lifecycle hook times out.
|
PutLifecycleHookRequest |
withLifecycleHookName(String lifecycleHookName)
The name of the lifecycle hook.
|
PutLifecycleHookRequest |
withLifecycleTransition(String lifecycleTransition)
The instance state to which you want to attach the lifecycle hook.
|
PutLifecycleHookRequest |
withNotificationMetadata(String notificationMetadata)
Contains additional information that you want to include any time Auto
Scaling sends a message to the notification target.
|
PutLifecycleHookRequest |
withNotificationTargetARN(String notificationTargetARN)
The ARN of the notification target that Auto Scaling will use to
notify you when an instance is in the transition state for the
lifecycle hook.
|
PutLifecycleHookRequest |
withRoleARN(String roleARN)
The ARN of the IAM role that allows the Auto Scaling group to publish
to the specified notification target.
|
copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public String getLifecycleHookName()
Constraints:
Length: 1 - 255
Pattern: [A-Za-z0-9\-_\/]+
public void setLifecycleHookName(String lifecycleHookName)
Constraints:
Length: 1 - 255
Pattern: [A-Za-z0-9\-_\/]+
lifecycleHookName
- The name of the lifecycle hook.public PutLifecycleHookRequest withLifecycleHookName(String lifecycleHookName)
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 String getAutoScalingGroupName()
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
public void setAutoScalingGroupName(String autoScalingGroupName)
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
autoScalingGroupName
- The name of the Auto Scaling group to which you want to assign the
lifecycle hook.public PutLifecycleHookRequest withAutoScalingGroupName(String autoScalingGroupName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
autoScalingGroupName
- The name of the Auto Scaling group to which you want to assign the
lifecycle hook.public String getLifecycleTransition()
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public void setLifecycleTransition(String lifecycleTransition)
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
lifecycleTransition
- The instance state to which you want to attach the lifecycle hook. For
a list of lifecycle hook types, see DescribeLifecycleHookTypes.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public PutLifecycleHookRequest withLifecycleTransition(String lifecycleTransition)
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
Returns a reference to this object so that method calls can be chained together.
lifecycleTransition
- The instance state to which you want to attach the lifecycle hook. For
a list of lifecycle hook types, see DescribeLifecycleHookTypes.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public String getRoleARN()
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public void setRoleARN(String roleARN)
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
roleARN
- The ARN of the IAM role that allows the Auto Scaling group to publish
to the specified notification target. This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public PutLifecycleHookRequest withRoleARN(String roleARN)
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
roleARN
- The ARN of the IAM role that allows the Auto Scaling group to publish
to the specified notification target. This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public String getNotificationTargetARN()
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
The notification message sent to the target will include:
This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.
When you call this operation,
a test message is sent to the notification target. This test message
contains an additional key/value pair:
Event:autoscaling:TEST_NOTIFICATION
.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
The notification message sent to the target will include:
This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.
When you call this operation,
a test message is sent to the notification target. This test message
contains an additional key/value pair:
Event:autoscaling:TEST_NOTIFICATION
.
public void setNotificationTargetARN(String notificationTargetARN)
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
The notification message sent to the target will include:
This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.
When you call this operation,
a test message is sent to the notification target. This test message
contains an additional key/value pair:
Event:autoscaling:TEST_NOTIFICATION
.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
notificationTargetARN
- The ARN of the notification target that Auto Scaling will use 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. This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
The notification message sent to the target will include:
This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.
When you call this operation,
a test message is sent to the notification target. This test message
contains an additional key/value pair:
Event:autoscaling:TEST_NOTIFICATION
.
public PutLifecycleHookRequest withNotificationTargetARN(String notificationTargetARN)
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
The notification message sent to the target will include:
This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.
When you call this operation,
a test message is sent to the notification target. This test message
contains an additional key/value pair:
Event:autoscaling:TEST_NOTIFICATION
.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
notificationTargetARN
- The ARN of the notification target that Auto Scaling will use 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. This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
The notification message sent to the target will include:
This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.
When you call this operation,
a test message is sent to the notification target. This test message
contains an additional key/value pair:
Event:autoscaling:TEST_NOTIFICATION
.
public String getNotificationMetadata()
Constraints:
Length: 1 - 1023
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
public void setNotificationMetadata(String notificationMetadata)
Constraints:
Length: 1 - 1023
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
notificationMetadata
- Contains additional information that you want to include any time Auto
Scaling sends a message to the notification target.public PutLifecycleHookRequest withNotificationMetadata(String notificationMetadata)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1023
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
notificationMetadata
- Contains additional information that you want to include any time Auto
Scaling sends a message to the notification target.public Integer getHeartbeatTimeout()
DefaultResult
parameter. You can prevent the lifecycle hook from timing out by
calling RecordLifecycleActionHeartbeat. The default value for
this parameter is 3600 seconds (1 hour).DefaultResult
parameter. You can prevent the lifecycle hook from timing out by
calling RecordLifecycleActionHeartbeat. The default value for
this parameter is 3600 seconds (1 hour).public void setHeartbeatTimeout(Integer heartbeatTimeout)
DefaultResult
parameter. You can prevent the lifecycle hook from timing out by
calling RecordLifecycleActionHeartbeat. The default value for
this parameter is 3600 seconds (1 hour).heartbeatTimeout
- Defines the amount of time, in seconds, that can elapse before the
lifecycle hook times out. When the lifecycle hook times out, Auto
Scaling performs the action defined in the DefaultResult
parameter. You can prevent the lifecycle hook from timing out by
calling RecordLifecycleActionHeartbeat. The default value for
this parameter is 3600 seconds (1 hour).public PutLifecycleHookRequest withHeartbeatTimeout(Integer heartbeatTimeout)
DefaultResult
parameter. You can prevent the lifecycle hook from timing out by
calling RecordLifecycleActionHeartbeat. The default value for
this parameter is 3600 seconds (1 hour).
Returns a reference to this object so that method calls can be chained together.
heartbeatTimeout
- Defines the amount of time, in seconds, that can elapse before the
lifecycle hook times out. When the lifecycle hook times out, Auto
Scaling performs the action defined in the DefaultResult
parameter. You can prevent the lifecycle hook from timing out by
calling RecordLifecycleActionHeartbeat. The default value for
this parameter is 3600 seconds (1 hour).public String getDefaultResult()
CONTINUE
or
ABANDON
. The default value for this parameter is
ABANDON
.CONTINUE
or
ABANDON
. The default value for this parameter is
ABANDON
.public void setDefaultResult(String defaultResult)
CONTINUE
or
ABANDON
. The default value for this parameter is
ABANDON
.defaultResult
- Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure occurs. The
value for this parameter can be either CONTINUE
or
ABANDON
. The default value for this parameter is
ABANDON
.public PutLifecycleHookRequest withDefaultResult(String defaultResult)
CONTINUE
or
ABANDON
. The default value for this parameter is
ABANDON
.
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
value for this parameter can be either CONTINUE
or
ABANDON
. The default value for this parameter is
ABANDON
.public String toString()
toString
in class Object
Object.toString()
public PutLifecycleHookRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2015. All rights reserved.