Table of Contents

Interface IBasicLifecycleHookProps

Namespace
Amazon.CDK.AWS.AutoScaling
Assembly
Amazon.CDK.AWS.AutoScaling.dll

Basic properties for a lifecycle hook.

public interface IBasicLifecycleHookProps

Examples

// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK.AWS.AutoScaling;
            using Amazon.CDK.AWS.IAM;
            using Amazon.CDK;

            ILifecycleHookTarget lifecycleHookTarget;
            Role role;
            var basicLifecycleHookProps = new BasicLifecycleHookProps {
                LifecycleTransition = LifecycleTransition.INSTANCE_LAUNCHING,

                // the properties below are optional
                DefaultResult = DefaultResult.CONTINUE,
                HeartbeatTimeout = Duration.Minutes(30),
                LifecycleHookName = "lifecycleHookName",
                NotificationMetadata = "notificationMetadata",
                NotificationTarget = lifecycleHookTarget,
                Role = role
            };

Remarks

ExampleMetadata: fixture=_generated

Properties

DefaultResult

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

DefaultResult? DefaultResult { get; }

Property Value

DefaultResult?

Remarks

Default: Continue

HeartbeatTimeout

Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.

Duration? HeartbeatTimeout { get; }

Property Value

Duration

Remarks

If the lifecycle hook times out, perform the action in DefaultResult.

Default: - No heartbeat timeout.

LifecycleHookName

Name of the lifecycle hook.

string? LifecycleHookName { get; }

Property Value

string

Remarks

Default: - Automatically generated name.

LifecycleTransition

The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.

LifecycleTransition LifecycleTransition { get; }

Property Value

LifecycleTransition

NotificationMetadata

Additional data to pass to the lifecycle hook target.

string? NotificationMetadata { get; }

Property Value

string

Remarks

Default: - No metadata.

NotificationTarget

The target of the lifecycle hook.

ILifecycleHookTarget? NotificationTarget { get; }

Property Value

ILifecycleHookTarget

Remarks

Default: - No target.

Role

The role that allows publishing to the notification target.

IRole? Role { get; }

Property Value

IRole

Remarks

Default: - A role will be created if a target is provided. Otherwise, no role is created.