AWS CloudFormation
User Guide (Version )

AWS::AutoScaling::AutoScalingGroup LifecycleHookSpecification

LifecycleHookSpecification specifies a list of lifecycle hooks for the LifecycleHookSpecificationList property of AutoScalingGroup. LifecycleHookSpecification defines lifecycle hooks for an Auto Scaling group that specify actions to perform when Amazon EC2 Auto Scaling launches or terminates instances.

For more information, see Amazon EC2 Auto Scaling Lifecycle Hooks in the Amazon EC2 Auto Scaling User Guide. You can find a sample template snippet in the Examples section of the AWS::AutoScaling::LifecycleHook documentation.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "DefaultResult" : String, "HeartbeatTimeout" : Integer, "LifecycleHookName" : String, "LifecycleTransition" : String, "NotificationMetadata" : String, "NotificationTargetARN" : String, "RoleARN" : String }

Properties

DefaultResult

The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The valid values are CONTINUE and ABANDON (default).

Required: No

Type: String

Update requires: No interruption

HeartbeatTimeout

The maximum time, in seconds, that can elapse before the lifecycle hook times out. If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the default action.

Required: No

Type: Integer

Update requires: No interruption

LifecycleHookName

The name of the lifecycle hook.

Required: Yes

Type: String

Minimum: 1

Maximum: 255

Pattern: [A-Za-z0-9\-_\/]+

Update requires: No interruption

LifecycleTransition

The state of the EC2 instance to attach the lifecycle hook to. The valid values are:

  • autoscaling:EC2_INSTANCE_LAUNCHING

  • autoscaling:EC2_INSTANCE_TERMINATING

Required: Yes

Type: String

Update requires: No interruption

NotificationMetadata

Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.

Required: No

Type: String

Minimum: 1

Maximum: 1023

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Update requires: No interruption

NotificationTargetARN

The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. You can specify an Amazon SQS queue or an Amazon SNS topic.

Required: No

Type: String

Minimum: 0

Maximum: 1600

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Update requires: No interruption

RoleARN

The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target, for example, an Amazon SNS topic or an Amazon SQS queue. For information about creating this role, see Preparing for Notifications in the Amazon EC2 Auto Scaling User Guide.

Required: No

Type: String

Minimum: 1

Maximum: 1600

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Update requires: No interruption

On this page: