# Signals

Configure whether the AutoScalingGroup waits for signals.

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.

- Source: [`aws-autoscaling/lib/auto-scaling-group.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts#L879)

## Example

```ts
declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;
declare const machineImage: ec2.IMachineImage;

new autoscaling.AutoScalingGroup(this, 'ASG', {
  vpc,
  instanceType,
  machineImage,

  // ...

  init: ec2.CloudFormationInit.fromElements(
    ec2.InitFile.fromString('/etc/my_instance', 'This got written during instance startup'),
  ),
  signals: autoscaling.Signals.waitForAll({
    timeout: Duration.minutes(10),
  }),
});
```

## Initializer

```ts
new Signals()
```

## Methods

- `renderCreationPolicy(renderOptions: RenderSignalsOptions): CfnCreationPolicy` — Render the ASG's CreationPolicy.

- `waitForAll(options?: SignalsOptions): Signals // chainable` (static) — Wait for the desiredCapacity of the AutoScalingGroup amount of signals to have been received.

  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(count: number, options?: SignalsOptions): Signals // chainable` (static) — Wait for a specific amount of signals to have been received.

  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(options?: SignalsOptions): Signals // chainable` (static) — Wait for the minCapacity of the AutoScalingGroup amount of signals to have been received.

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