LifecycleHook

class aws_cdk.aws_autoscaling.LifecycleHook(scope, id, *, auto_scaling_group, lifecycle_transition, notification_target, default_result=None, heartbeat_timeout=None, lifecycle_hook_name=None, notification_metadata=None, role=None)

Bases: aws_cdk.core.Resource

Define a life cycle hook.

__init__(scope, id, *, auto_scaling_group, lifecycle_transition, notification_target, default_result=None, heartbeat_timeout=None, lifecycle_hook_name=None, notification_metadata=None, role=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • props

  • auto_scaling_group (IAutoScalingGroup) – The AutoScalingGroup to add the lifecycle hook to.

  • lifecycle_transition (LifecycleTransition) – The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.

  • notification_target (ILifecycleHookTarget) – The target of the lifecycle hook.

  • default_result (Optional[DefaultResult]) – The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. Default: Continue

  • heartbeat_timeout (Optional[Duration]) – Maximum time between calls to RecordLifecycleActionHeartbeat for the hook. If the lifecycle hook times out, perform the action in DefaultResult. Default: - No heartbeat timeout.

  • lifecycle_hook_name (Optional[str]) – Name of the lifecycle hook. Default: - Automatically generated name.

  • notification_metadata (Optional[str]) – Additional data to pass to the lifecycle hook target. Default: - No metadata.

  • role (Optional[IRole]) – The role that allows publishing to the notification target. Default: - A role is automatically created.

Return type

None

Methods

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

lifecycle_hook_name

The name of this lifecycle hook.

attribute: :attribute:: true

Return type

str

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

role

The role that allows the ASG to publish to the notification target.

Return type

IRole

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool