# WarmPoolOptions

Struct · Stable

Options for a warm pool.

Used as argument in: [IAutoScalingGroup.addWarmPool](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.IAutoScalingGroup.html#addwarmpool)

- Source: [`aws-autoscaling/lib/warm-pool.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-autoscaling/lib/warm-pool.ts#L12)
- Type last changed: v2.18.0 · 29 Mar 2022

## Example

TypeScript:

```ts
declare const autoScalingGroup: autoscaling.AutoScalingGroup;

autoScalingGroup.addWarmPool({
  minSize: 1,
  reuseOnScaleIn: true,
});
```

Python:

```python
# auto_scaling_group: autoscaling.AutoScalingGroup

auto_scaling_group.add_warm_pool(
    min_size=1,
    reuse_on_scale_in=True
)
```

Java:

```java
AutoScalingGroup autoScalingGroup;

autoScalingGroup.addWarmPool(WarmPoolOptions.builder()
        .minSize(1)
        .reuseOnScaleIn(true)
        .build());
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
AutoScalingGroup autoScalingGroup;

autoScalingGroup.AddWarmPool(new WarmPoolOptions {
    MinSize = 1,
    ReuseOnScaleIn = true
});
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var autoScalingGroup AutoScalingGroup

autoScalingGroup.addWarmPool(&WarmPoolOptions{
	MinSize: jsii.Number(1),
	ReuseOnScaleIn: jsii.Boolean(true),
})
```

## Properties

- `maxGroupPreparedCapacity`: number — The maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.

  **Default:** max size of the Auto Scaling group

  If the value is not specified, Amazon EC2 Auto Scaling launches and maintains
  the difference between the group's maximum capacity and its desired capacity.

- `minSize`: number = 0 — The minimum number of instances to maintain in the warm pool.

- `poolState`: [PoolState](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.PoolState.html) = PoolState.STOPPED — The instance state to transition to after the lifecycle actions are complete.

- `reuseOnScaleIn`: boolean = false — Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.

  If the value is not specified, instances in the Auto Scaling group will be terminated
  when the group scales in.
