Safe Haskell | None |
---|---|
Language | Haskell2010 |
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:
Create a notification target. A target can be either an Amazon SQS queue or an Amazon SNS topic. Create an IAM role. This role allows Auto Scaling to publish lifecycle notifications to the designated SQS queue or SNS topic. Create the lifecycle hook. You can create a hook that acts when instances launch or when instances terminate. If necessary, record the lifecycle action heartbeat to keep the instance in a pending state. Complete the lifecycle action. For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide.
http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_PutLifecycleHook.html
- data PutLifecycleHook
- putLifecycleHook :: Text -> Text -> PutLifecycleHook
- plhAutoScalingGroupName :: Lens' PutLifecycleHook Text
- plhDefaultResult :: Lens' PutLifecycleHook (Maybe Text)
- plhHeartbeatTimeout :: Lens' PutLifecycleHook (Maybe Int)
- plhLifecycleHookName :: Lens' PutLifecycleHook Text
- plhLifecycleTransition :: Lens' PutLifecycleHook (Maybe Text)
- plhNotificationMetadata :: Lens' PutLifecycleHook (Maybe Text)
- plhNotificationTargetARN :: Lens' PutLifecycleHook (Maybe Text)
- plhRoleARN :: Lens' PutLifecycleHook (Maybe Text)
- data PutLifecycleHookResponse
- putLifecycleHookResponse :: PutLifecycleHookResponse
Request
data PutLifecycleHook Source
Request constructor
PutLifecycleHook
constructor.
The fields accessible through corresponding lenses are:
Request lenses
plhAutoScalingGroupName :: Lens' PutLifecycleHook Text Source
The name of the Auto Scaling group to which you want to assign the lifecycle hook.
plhDefaultResult :: Lens' PutLifecycleHook (Maybe Text) Source
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
.
plhHeartbeatTimeout :: Lens' PutLifecycleHook (Maybe Int) Source
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).
plhLifecycleHookName :: Lens' PutLifecycleHook Text Source
The name of the lifecycle hook.
plhLifecycleTransition :: Lens' PutLifecycleHook (Maybe Text) Source
The Amazon EC2 instance state to which you want to attach the lifecycle hook.
See DescribeLifecycleHookTypes
for a list of available lifecycle hook types.
This parameter is required for new lifecycle hooks, but optional when updating existing hooks.
plhNotificationMetadata :: Lens' PutLifecycleHook (Maybe Text) Source
Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
plhNotificationTargetARN :: Lens' PutLifecycleHook (Maybe Text) Source
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:
LifecycleActionToken. The Lifecycle action token. AccountId. The user account ID. AutoScalingGroupName. The name of the Auto Scaling group. LifecycleHookName . The lifecycle hook name. EC2InstanceId. The EC2 instance ID. LifecycleTransition . The lifecycle transition. NotificationMetadata. The notification metadata. 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'.
plhRoleARN :: Lens' PutLifecycleHook (Maybe Text) Source
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.