Skip to content

LifecycleHookSpecification

Source code in docs_src/capo_auto_scaling/types/lifecycle_hook_specification.py
class LifecycleHookSpecification(TypedDict, closed=True):
    lifecycle_hook_name: NotRequired[
        "capo_auto_scaling.types.ascii_string_max_len255.AsciiStringMaxLen255"
    ]
    """<p>The name of the lifecycle hook.</p>"""
    lifecycle_transition: NotRequired[
        "capo_auto_scaling.types.lifecycle_transition.LifecycleTransition"
    ]
    """<p>The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.</p> <ul> <li> <p>To create a lifecycle hook for scale-out events, specify <code>autoscaling:EC2_INSTANCE_LAUNCHING</code>.</p> </li> <li> <p>To create a lifecycle hook for scale-in events, specify <code>autoscaling:EC2_INSTANCE_TERMINATING</code>.</p> </li> </ul>"""
    notification_metadata: NotRequired[
        "capo_auto_scaling.types.any_printable_ascii_string_max_len4000.AnyPrintableAsciiStringMaxLen4000"
    ]
    """<p>Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.</p>"""
    heartbeat_timeout: NotRequired[
        "capo_auto_scaling.types.heartbeat_timeout.HeartbeatTimeout"
    ]
    """<p>The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from <code>30</code> to <code>7200</code> seconds. The default value is <code>3600</code> seconds (1 hour).</p>"""
    default_result: NotRequired[
        "capo_auto_scaling.types.lifecycle_action_result.LifecycleActionResult"
    ]
    """<p>The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is <code>ABANDON</code>.</p> <p>Valid values: <code>CONTINUE</code> | <code>ABANDON</code> </p>"""
    notification_target_arn: NotRequired[
        "capo_auto_scaling.types.notification_target_resource_name.NotificationTargetResourceName"
    ]
    """<p>The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.</p>"""
    role_arn: NotRequired[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ]
    """<p>The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html">Prepare to add a lifecycle hook to your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.</p>"""

default_result instance-attribute

default_result: NotRequired[LifecycleActionResult]

The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is ABANDON.

Valid values: CONTINUE | ABANDON

heartbeat_timeout instance-attribute

heartbeat_timeout: NotRequired[HeartbeatTimeout]

The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from 30 to 7200 seconds. The default value is 3600 seconds (1 hour).

lifecycle_hook_name instance-attribute

lifecycle_hook_name: NotRequired[AsciiStringMaxLen255]

The name of the lifecycle hook.

lifecycle_transition instance-attribute

lifecycle_transition: NotRequired[LifecycleTransition]

The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.

  • To create a lifecycle hook for scale-out events, specify autoscaling:EC2_INSTANCE_LAUNCHING.

  • To create a lifecycle hook for scale-in events, specify autoscaling:EC2_INSTANCE_TERMINATING.

notification_metadata instance-attribute

notification_metadata: NotRequired[AnyPrintableAsciiStringMaxLen4000]

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

notification_target_arn instance-attribute

notification_target_arn: NotRequired[NotificationTargetResourceName]

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

role_arn instance-attribute

role_arn: NotRequired[XmlStringMaxLen255]

The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see Prepare to add a lifecycle hook to your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.

Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.