CfnLifecycleHookProps

class aws_cdk.aws_autoscaling.CfnLifecycleHookProps(*, auto_scaling_group_name, lifecycle_transition, default_result=None, heartbeat_timeout=None, lifecycle_hook_name=None, notification_metadata=None, notification_target_arn=None, role_arn=None)

Bases: object

Properties for defining a CfnLifecycleHook.

Parameters:
  • auto_scaling_group_name (str) – The name of the Auto Scaling group.

  • lifecycle_transition (str) – 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 .

  • default_result (Optional[str]) – 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 (Union[int, float, None]) – 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 (Optional[str]) – The name of the lifecycle hook.

  • notification_metadata (Optional[str]) – Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.

  • notification_target_arn (Optional[str]) – 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 (Optional[str]) – 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 Configure a notification target for a lifecycle hook in the Amazon EC2 Auto Scaling User Guide . Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_autoscaling as autoscaling

cfn_lifecycle_hook_props = autoscaling.CfnLifecycleHookProps(
    auto_scaling_group_name="autoScalingGroupName",
    lifecycle_transition="lifecycleTransition",

    # the properties below are optional
    default_result="defaultResult",
    heartbeat_timeout=123,
    lifecycle_hook_name="lifecycleHookName",
    notification_metadata="notificationMetadata",
    notification_target_arn="notificationTargetArn",
    role_arn="roleArn"
)

Attributes

auto_scaling_group_name

The name of the Auto Scaling group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-autoscalinggroupname

default_result

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-defaultresult

heartbeat_timeout

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).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-heartbeattimeout

lifecycle_hook_name

The name of the lifecycle hook.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-lifecyclehookname

lifecycle_transition

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-lifecycletransition

notification_metadata

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-notificationmetadata

notification_target_arn

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-notificationtargetarn

role_arn

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 Configure a notification target for a lifecycle hook in the Amazon EC2 Auto Scaling User Guide .

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html#cfn-autoscaling-lifecyclehook-rolearn