aws-cdk-lib.aws_autoscaling.WarmPool

class WarmPool (construct)

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.WarmPool
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#WarmPool
Javasoftware.amazon.awscdk.services.autoscaling.WarmPool
Pythonaws_cdk.aws_autoscaling.WarmPool
TypeScript (source)aws-cdk-lib » aws_autoscaling » WarmPool

Implements IConstruct, IDependable, IResource

Define a warm pool.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';

declare const autoScalingGroup: autoscaling.AutoScalingGroup;
const warmPool = new autoscaling.WarmPool(this, 'MyWarmPool', {
  autoScalingGroup: autoScalingGroup,

  // the properties below are optional
  maxGroupPreparedCapacity: 123,
  minSize: 123,
  poolState: autoscaling.PoolState.HIBERNATED,
  reuseOnScaleIn: false,
});

Initializer

new WarmPool(scope: Construct, id: string, props: WarmPoolProps)

Parameters

  • scope Construct
  • id string
  • props WarmPoolProps

Construct Props

NameTypeDescription
autoScalingGroupIAutoScalingGroupThe Auto Scaling group to add the warm pool to.
maxGroupPreparedCapacity?numberThe maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group.
minSize?numberThe minimum number of instances to maintain in the warm pool.
poolState?PoolStateThe instance state to transition to after the lifecycle actions are complete.
reuseOnScaleIn?booleanIndicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.

autoScalingGroup

Type: IAutoScalingGroup

The Auto Scaling group to add the warm pool to.


maxGroupPreparedCapacity?

Type: number (optional, default: max size of the Auto Scaling group)

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.

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?

Type: number (optional, default: 0)

The minimum number of instances to maintain in the warm pool.


poolState?

Type: PoolState (optional, default: PoolState.STOPPED)

The instance state to transition to after the lifecycle actions are complete.


reuseOnScaleIn?

Type: boolean (optional, default: 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.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.

env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.