Class LifecycleHook
- Namespace
- Amazon.CDK.AWS.AutoScaling
- Assembly
- Amazon.CDK.AWS.AutoScaling.dll
Define a life cycle hook.
public class LifecycleHook : Resource, ILifecycleHook, IResource, IConstruct, IConstruct, IDependable
- Inheritance
-
LifecycleHook
- Implements
-
IResourceIConstructIConstructIDependable
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 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
});
Remarks
ExampleMetadata: fixture=_generated
Constructors
LifecycleHook(Construct, string, ILifecycleHookProps)
public LifecycleHook(Construct scope, string id, ILifecycleHookProps props)
Parameters
scope
Constructid
stringprops
ILifecycleHookProps
Properties
LifecycleHookName
The name of this lifecycle hook.
public virtual string LifecycleHookName { get; }
Property Value
Remarks
Attribute: true
Role
The role that allows the ASG to publish to the notification target.
public virtual IRole Role { get; }
Property Value
- IRole
Remarks
Default: - A default role is created if 'notificationTarget' is specified. Otherwise, no role is created.