Class LifecycleHookProps
Properties for a Lifecycle hook.
Inheritance
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.AWS.AutoScaling.dll
Syntax (csharp)
public class LifecycleHookProps : Object, ILifecycleHookProps, IBasicLifecycleHookProps
Syntax (vb)
Public Class LifecycleHookProps
Inherits Object
Implements ILifecycleHookProps, IBasicLifecycleHookProps
Remarks
ExampleMetadata: fixture=_generated
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;
AutoScalingGroup autoScalingGroup;
ILifecycleHookTarget lifecycleHookTarget;
Role role;
var lifecycleHookProps = new LifecycleHookProps {
AutoScalingGroup = autoScalingGroup,
LifecycleTransition = LifecycleTransition.INSTANCE_LAUNCHING,
// the properties below are optional
DefaultResult = DefaultResult.CONTINUE,
HeartbeatTimeout = Duration.Minutes(30),
LifecycleHookName = "lifecycleHookName",
NotificationMetadata = "notificationMetadata",
NotificationTarget = lifecycleHookTarget,
Role = role
};
Synopsis
Constructors
LifecycleHookProps() |
Properties
AutoScalingGroup | The AutoScalingGroup to add the lifecycle hook to. |
DefaultResult | The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. |
HeartbeatTimeout | Maximum time between calls to RecordLifecycleActionHeartbeat for the hook. |
LifecycleHookName | Name of the lifecycle hook. |
LifecycleTransition | The state of the Amazon EC2 instance to which you want to attach the lifecycle hook. |
NotificationMetadata | Additional data to pass to the lifecycle hook target. |
NotificationTarget | The target of the lifecycle hook. |
Role | The role that allows publishing to the notification target. |
Constructors
LifecycleHookProps()
public LifecycleHookProps()
Properties
AutoScalingGroup
The AutoScalingGroup to add the lifecycle hook to.
public IAutoScalingGroup AutoScalingGroup { get; set; }
Property Value
DefaultResult
The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.
public Nullable<DefaultResult> DefaultResult { get; set; }
Property Value
System.Nullable<DefaultResult>
Remarks
Default: Continue
HeartbeatTimeout
Maximum time between calls to RecordLifecycleActionHeartbeat for the hook.
public Duration HeartbeatTimeout { get; set; }
Property Value
Remarks
If the lifecycle hook times out, perform the action in DefaultResult.
Default: - No heartbeat timeout.
LifecycleHookName
Name of the lifecycle hook.
public string LifecycleHookName { get; set; }
Property Value
System.String
Remarks
Default: - Automatically generated name.
LifecycleTransition
The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.
public LifecycleTransition LifecycleTransition { get; set; }
Property Value
NotificationMetadata
Additional data to pass to the lifecycle hook target.
public string NotificationMetadata { get; set; }
Property Value
System.String
Remarks
Default: - No metadata.
NotificationTarget
The target of the lifecycle hook.
public ILifecycleHookTarget NotificationTarget { get; set; }
Property Value
Remarks
Default: - No target.
Role
The role that allows publishing to the notification target.
public IRole Role { get; set; }
Property Value
Remarks
Default: - A role will be created if a target is provided. Otherwise, no role is created.