Table of Contents

Class Signals

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

Configure whether the AutoScalingGroup waits for signals.

public abstract class Signals : DeputyBase
Inheritance
Signals

Examples

Vpc vpc;
             InstanceType instanceType;
             IMachineImage machineImage;


             new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
                 Vpc = vpc,
                 InstanceType = instanceType,
                 MachineImage = machineImage,

                 // ...

                 Init = CloudFormationInit.FromElements(InitFile.FromString("/etc/my_instance", "This got written during instance startup")),
                 Signals = Signals.WaitForAll(new SignalsOptions {
                     Timeout = Duration.Minutes(10)
                 })
             });

Remarks

If you do configure waiting for signals, you should make sure the instances invoke cfn-signal somewhere in their UserData to signal that they have started up (either successfully or unsuccessfully).

Signals are used both during intial creation and subsequent updates.

ExampleMetadata: infused

Constructors

Signals()

protected Signals()

Methods

DoRender(ISignalsOptions, double?)

Helper to render the actual creation policy, as the logic between them is quite similar.

protected virtual ICfnCreationPolicy DoRender(ISignalsOptions options, double? count = null)

Parameters

options ISignalsOptions
count double?

Returns

ICfnCreationPolicy

RenderCreationPolicy(IRenderSignalsOptions)

Render the ASG's CreationPolicy.

public abstract ICfnCreationPolicy RenderCreationPolicy(IRenderSignalsOptions renderOptions)

Parameters

renderOptions IRenderSignalsOptions

Returns

ICfnCreationPolicy

WaitForAll(ISignalsOptions?)

Wait for the desiredCapacity of the AutoScalingGroup amount of signals to have been received.

public static Signals WaitForAll(ISignalsOptions? options = null)

Parameters

options ISignalsOptions

Returns

Signals

Remarks

If no desiredCapacity has been configured, wait for minCapacity signals intead.

This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.

WaitForCount(double, ISignalsOptions?)

Wait for a specific amount of signals to have been received.

public static Signals WaitForCount(double count, ISignalsOptions? options = null)

Parameters

count double
options ISignalsOptions

Returns

Signals

Remarks

You should send one signal per instance, so this represents the number of instances to wait for.

This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.

WaitForMinCapacity(ISignalsOptions?)

Wait for the minCapacity of the AutoScalingGroup amount of signals to have been received.

public static Signals WaitForMinCapacity(ISignalsOptions? options = null)

Parameters

options ISignalsOptions

Returns

Signals

Remarks

This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.