Class LifecycleHook
Define a life cycle hook.
Inherited Members
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LifecycleHook : Resource, ILifecycleHook, IResource, IConstruct, IDependable
Syntax (vb)
Public Class LifecycleHook Inherits Resource Implements ILifecycleHook, IResource, IConstruct, IDependable
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;
using Amazon.CDK.AWS.AutoScaling;
using Amazon.CDK.AWS.IAM;
AutoScalingGroup autoScalingGroup;
ILifecycleHookTarget lifecycleHookTarget;
Role role;
var lifecycleHook = new LifecycleHook(this, "MyLifecycleHook", 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
LifecycleHook(Construct, string, ILifecycleHookProps) | Define a life cycle hook. |
Properties
LifecycleHookName | The name of this lifecycle hook. |
PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Role | The role that allows the ASG to publish to the notification target. |
Constructors
LifecycleHook(Construct, string, ILifecycleHookProps)
Define a life cycle hook.
public LifecycleHook(Construct scope, string id, ILifecycleHookProps props)
Parameters
- scope Construct
- id string
- props ILifecycleHookProps
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;
using Amazon.CDK.AWS.AutoScaling;
using Amazon.CDK.AWS.IAM;
AutoScalingGroup autoScalingGroup;
ILifecycleHookTarget lifecycleHookTarget;
Role role;
var lifecycleHook = new LifecycleHook(this, "MyLifecycleHook", 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
});
Properties
LifecycleHookName
The name of this lifecycle hook.
public virtual string LifecycleHookName { get; }
Property Value
Remarks
Attribute: true
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
ExampleMetadata: fixture=_generated
Role
The role that allows the ASG to publish to the notification target.
public virtual IRole Role { get; }
Property Value
Remarks
Default: - A default role is created if 'notificationTarget' is specified. Otherwise, no role is created.
Implements
Constructs.IConstruct
Constructs.IDependable