public class PutLifecycleHookRequest extends AmazonWebServiceRequest implements java.io.Serializable
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 step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Lifecycle 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.
Constructor and Description |
---|
PutLifecycleHookRequest() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAutoScalingGroupName()
The name of the Auto Scaling group to which you want to assign 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 |
getHeartbeatTimeout()
The amount of 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 instance state to which you want to attach the lifecycle hook.
|
java.lang.String |
getNotificationMetadata()
Contains 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 will use 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 to which you want to assign 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 |
setHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
The amount of 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 instance state to which you want to attach the lifecycle hook.
|
void |
setNotificationMetadata(java.lang.String notificationMetadata)
Contains 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 will use 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.
|
PutLifecycleHookRequest |
withAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group to which you want to assign the
lifecycle hook.
|
PutLifecycleHookRequest |
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.
|
PutLifecycleHookRequest |
withHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
The amount of time, in seconds, that can elapse before the lifecycle hook
times out.
|
PutLifecycleHookRequest |
withLifecycleHookName(java.lang.String lifecycleHookName)
The name of the lifecycle hook.
|
PutLifecycleHookRequest |
withLifecycleTransition(java.lang.String lifecycleTransition)
The instance state to which you want to attach the lifecycle hook.
|
PutLifecycleHookRequest |
withNotificationMetadata(java.lang.String notificationMetadata)
Contains additional information that you want to include any time Auto
Scaling sends a message to the notification target.
|
PutLifecycleHookRequest |
withNotificationTargetARN(java.lang.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(java.lang.String roleARN)
The ARN of the IAM role that allows the Auto Scaling group to publish to
the specified notification target.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
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 PutLifecycleHookRequest 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 to which you want to assign the lifecycle hook.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
The name of the Auto Scaling group to which you want to assign the lifecycle hook.
public void setAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group to which you want to assign the lifecycle hook.
Constraints:
Length: 1 - 1600
Pattern: [ --�𐀀-\r\n\t]*
autoScalingGroupName
- The name of the Auto Scaling group to which you want to assign the lifecycle hook.
public PutLifecycleHookRequest withAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group to which you want to assign 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 to which you want to assign the lifecycle hook.
public java.lang.String getLifecycleTransition()
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.
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 void setLifecycleTransition(java.lang.String 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.
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(java.lang.String 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.
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 java.lang.String getRoleARN()
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.
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.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
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.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
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.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public PutLifecycleHookRequest withRoleARN(java.lang.String 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.
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.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
public java.lang.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. This target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN.
The notification messages sent to the target include the following information:
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 specify a notification target, Auto Scaling sends it a test
message. Test messages contains the following additional key/value pair:
"Event": "autoscaling:TEST_NOTIFICATION"
.
Constraints:
Length: 0 - 1600
Pattern: [ --�𐀀-\r\n\t]*
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 target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN.
The notification messages sent to the target include the following information:
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 specify a notification target, Auto Scaling sends it a
test message. Test messages contains the following additional
key/value pair:
"Event": "autoscaling:TEST_NOTIFICATION"
.
public void setNotificationTargetARN(java.lang.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. This target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN.
The notification messages sent to the target include the following information:
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 specify a notification target, Auto Scaling sends it a test
message. Test messages contains the following additional key/value pair:
"Event": "autoscaling:TEST_NOTIFICATION"
.
Constraints:
Length: 0 - 1600
Pattern: [ --�𐀀-\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 target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN.
The notification messages sent to the target include the following information:
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 specify a notification target, Auto Scaling sends it
a test message. Test messages contains the following
additional key/value pair:
"Event": "autoscaling:TEST_NOTIFICATION"
.
public PutLifecycleHookRequest withNotificationTargetARN(java.lang.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. This target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN.
The notification messages sent to the target include the following information:
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 specify a notification target, Auto Scaling sends it a test
message. Test messages contains the following additional key/value pair:
"Event": "autoscaling:TEST_NOTIFICATION"
.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 1600
Pattern: [ --�𐀀-\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 target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN.
The notification messages sent to the target include the following information:
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 specify a notification target, Auto Scaling sends it
a test message. Test messages contains the following
additional key/value pair:
"Event": "autoscaling:TEST_NOTIFICATION"
.
public java.lang.String getNotificationMetadata()
Contains 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]*
Contains 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)
Contains 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
- Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
public PutLifecycleHookRequest withNotificationMetadata(java.lang.String notificationMetadata)
Contains 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
- Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
public java.lang.Integer getHeartbeatTimeout()
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 default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. The default is 3600 seconds (1 hour).
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 default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. The default is 3600 seconds (1 hour).
public void setHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
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 default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. The default is 3600 seconds (1 hour).
heartbeatTimeout
- 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 default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. The default is 3600 seconds (1 hour).
public PutLifecycleHookRequest withHeartbeatTimeout(java.lang.Integer heartbeatTimeout)
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 default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. The default is 3600 seconds (1 hour).
Returns a reference to this object so that method calls can be chained together.
heartbeatTimeout
- 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 default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. The default is 3600 seconds (1 hour).
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. This parameter
can be either CONTINUE
or ABANDON
. The default
value is ABANDON
.
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure
occurs. This parameter can be either CONTINUE
or
ABANDON
. The default value is ABANDON
.
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. This parameter
can be either CONTINUE
or ABANDON
. The default
value is ABANDON
.
defaultResult
-
Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure
occurs. This parameter can be either CONTINUE
or
ABANDON
. The default value is
ABANDON
.
public PutLifecycleHookRequest 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. This parameter
can be either CONTINUE
or ABANDON
. The default
value 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. This parameter can be either CONTINUE
or
ABANDON
. The default value is
ABANDON
.
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.