putWarmPool

abstract suspend fun putWarmPool(input: PutWarmPoolRequest): PutWarmPoolResponse

Creates or updates a warm pool for the specified Auto Scaling group. A warm pool is a pool of pre-initialized EC2 instances that sits alongside the Auto Scaling group. Whenever your application needs to scale out, the Auto Scaling group can draw on the warm pool to meet its new desired capacity. For more information and example configurations, see Warm pools for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.

This operation must be called from the Region in which the Auto Scaling group was created. This operation cannot be called on an Auto Scaling group that has a mixed instances policy or a launch template or launch configuration that requests Spot Instances.

You can view the instances in the warm pool using the DescribeWarmPool API call. If you are no longer using a warm pool, you can delete it by calling the DeleteWarmPool API.

Samples


fun main() { 
   //sampleStart 
   // This example creates a warm pool for the specified Auto Scaling group.
autoScalingClient.putWarmPool {
    autoScalingGroupName = "my-auto-scaling-group"
    minSize = 30
    poolState = WarmPoolState.fromValue("Hibernated")
    instanceReusePolicy = InstanceReusePolicy {
        reuseOnScaleIn = true
    }
} 
   //sampleEnd
}