WarmPool
The WarmPool resource lets you manage AWS AutoScaling WarmPools that help reduce the time it takes to launch EC2 instances in response to scaling events.
Minimal Example
Section titled “Minimal Example”Create a basic WarmPool with required properties and a common optional property.
import AWS from "alchemy/aws/control";
const warmPool = await AWS.AutoScaling.WarmPool("myWarmPool", { AutoScalingGroupName: "myAutoScalingGroup", MinSize: 2});
Advanced Configuration
Section titled “Advanced Configuration”Configure a WarmPool with additional settings including a reuse policy.
const advancedWarmPool = await AWS.AutoScaling.WarmPool("advancedWarmPool", { AutoScalingGroupName: "myAutoScalingGroup", MinSize: 2, MaxGroupPreparedCapacity: 5, InstanceReusePolicy: { ReuseOnScaleIn: true, ReuseOnScaleOut: false }});
Specific Use Case: Instance Reuse Policy
Section titled “Specific Use Case: Instance Reuse Policy”Create a WarmPool with a specific instance reuse policy for scaling in.
const reusePolicyWarmPool = await AWS.AutoScaling.WarmPool("reusePolicyWarmPool", { AutoScalingGroupName: "myAutoScalingGroup", MinSize: 3, InstanceReusePolicy: { ReuseOnScaleIn: true, ReuseOnScaleOut: true }});
Specific Use Case: Pool State Management
Section titled “Specific Use Case: Pool State Management”Set up a WarmPool with a defined pool state.
const stateManagedWarmPool = await AWS.AutoScaling.WarmPool("stateManagedWarmPool", { AutoScalingGroupName: "myAutoScalingGroup", MinSize: 1, PoolState: "Pending"});