amazonka-autoscaling-1.6.1: Amazon Auto Scaling SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.AutoScaling.PutLifecycleHook

Contents

Description

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:

  • (Optional) Create a Lambda function and a rule that allows CloudWatch Events to invoke your Lambda function when Auto Scaling launches or terminates instances.
  • (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Auto Scaling to publish lifecycle notifications to the target.
  • Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.
  • If you need more time, record the lifecycle action heartbeat to keep the instance in a pending state.
  • If you finish before the timeout period ends, complete the lifecycle action.

For more information, see Auto Scaling Lifecycle Hooks in the Auto Scaling User Guide .

If you exceed your maximum limit of lifecycle hooks, which by default is 50 per Auto Scaling group, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference .

Synopsis

Creating a Request

putLifecycleHook Source #

Creates a value of PutLifecycleHook with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • plhDefaultResult - 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 .
  • plhHeartbeatTimeout - The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from 30 to 7200 seconds. The default is 3600 seconds (1 hour). If the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat .
  • plhNotificationMetadata - Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.
  • plhNotificationTargetARN - 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. This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email keyvalue 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 keyvalue pair: Event: "autoscaling:TEST_NOTIFICATION" .
  • plhLifecycleTransition - 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.
  • plhRoleARN - 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.
  • plhLifecycleHookName - The name of the lifecycle hook.
  • plhAutoScalingGroupName - The name of the Auto Scaling group.

data PutLifecycleHook Source #

See: putLifecycleHook smart constructor.

Instances
Eq PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Data PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutLifecycleHook -> c PutLifecycleHook #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutLifecycleHook #

toConstr :: PutLifecycleHook -> Constr #

dataTypeOf :: PutLifecycleHook -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PutLifecycleHook) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutLifecycleHook) #

gmapT :: (forall b. Data b => b -> b) -> PutLifecycleHook -> PutLifecycleHook #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutLifecycleHook -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutLifecycleHook -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutLifecycleHook -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutLifecycleHook -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutLifecycleHook -> m PutLifecycleHook #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutLifecycleHook -> m PutLifecycleHook #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutLifecycleHook -> m PutLifecycleHook #

Read PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Show PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Generic PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Associated Types

type Rep PutLifecycleHook :: Type -> Type #

Hashable PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

AWSRequest PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Associated Types

type Rs PutLifecycleHook :: Type #

ToHeaders PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

ToPath PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

ToQuery PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

NFData PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Methods

rnf :: PutLifecycleHook -> () #

type Rep PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

type Rep PutLifecycleHook = D1 (MetaData "PutLifecycleHook" "Network.AWS.AutoScaling.PutLifecycleHook" "amazonka-autoscaling-1.6.1-AbdWdH026wCXAk2CK79vG" False) (C1 (MetaCons "PutLifecycleHook'" PrefixI True) (((S1 (MetaSel (Just "_plhDefaultResult") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_plhHeartbeatTimeout") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int))) :*: (S1 (MetaSel (Just "_plhNotificationMetadata") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_plhNotificationTargetARN") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 (MetaSel (Just "_plhLifecycleTransition") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_plhRoleARN") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "_plhLifecycleHookName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_plhAutoScalingGroupName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))
type Rs PutLifecycleHook Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Request Lenses

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. This parameter can be either CONTINUE or ABANDON . The default value is ABANDON .

plhHeartbeatTimeout :: Lens' PutLifecycleHook (Maybe Int) Source #

The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from 30 to 7200 seconds. The default is 3600 seconds (1 hour). If the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat .

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 target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN. This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email keyvalue 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 keyvalue pair: Event: "autoscaling:TEST_NOTIFICATION" .

plhLifecycleTransition :: Lens' PutLifecycleHook (Maybe Text) Source #

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.

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.

plhLifecycleHookName :: Lens' PutLifecycleHook Text Source #

The name of the lifecycle hook.

plhAutoScalingGroupName :: Lens' PutLifecycleHook Text Source #

The name of the Auto Scaling group.

Destructuring the Response

putLifecycleHookResponse Source #

Creates a value of PutLifecycleHookResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data PutLifecycleHookResponse Source #

See: putLifecycleHookResponse smart constructor.

Instances
Eq PutLifecycleHookResponse Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Data PutLifecycleHookResponse Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutLifecycleHookResponse -> c PutLifecycleHookResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutLifecycleHookResponse #

toConstr :: PutLifecycleHookResponse -> Constr #

dataTypeOf :: PutLifecycleHookResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PutLifecycleHookResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutLifecycleHookResponse) #

gmapT :: (forall b. Data b => b -> b) -> PutLifecycleHookResponse -> PutLifecycleHookResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutLifecycleHookResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutLifecycleHookResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutLifecycleHookResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutLifecycleHookResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutLifecycleHookResponse -> m PutLifecycleHookResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutLifecycleHookResponse -> m PutLifecycleHookResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutLifecycleHookResponse -> m PutLifecycleHookResponse #

Read PutLifecycleHookResponse Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Show PutLifecycleHookResponse Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Generic PutLifecycleHookResponse Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

Associated Types

type Rep PutLifecycleHookResponse :: Type -> Type #

NFData PutLifecycleHookResponse Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

type Rep PutLifecycleHookResponse Source # 
Instance details

Defined in Network.AWS.AutoScaling.PutLifecycleHook

type Rep PutLifecycleHookResponse = D1 (MetaData "PutLifecycleHookResponse" "Network.AWS.AutoScaling.PutLifecycleHook" "amazonka-autoscaling-1.6.1-AbdWdH026wCXAk2CK79vG" True) (C1 (MetaCons "PutLifecycleHookResponse'" PrefixI True) (S1 (MetaSel (Just "_plhrsResponseStatus") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

Response Lenses