Class CfnWarmPool

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:13.009Z") @Stability(Stable) public class CfnWarmPool extends CfnResource implements IInspectable
The AWS::AutoScaling::WarmPool resource creates 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.

When you create a warm pool, you can define a minimum size. When your Auto Scaling group scales out and the size of the warm pool shrinks, Amazon EC2 Auto Scaling launches new instances into the warm pool to maintain its minimum size.

For more information, see Warm pools for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide .

CloudFormation supports the UpdatePolicy attribute for Auto Scaling groups. During an update, if UpdatePolicy is set to AutoScalingRollingUpdate , CloudFormation replaces InService instances only. Instances in the warm pool are not replaced. The difference in which instances are replaced can potentially result in different instance configurations after the stack update completes. If UpdatePolicy is set to AutoScalingReplacingUpdate , you do not encounter this issue because CloudFormation replaces both the Auto Scaling group and the warm pool.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.autoscaling.*;
 CfnWarmPool cfnWarmPool = CfnWarmPool.Builder.create(this, "MyCfnWarmPool")
         .autoScalingGroupName("autoScalingGroupName")
         // the properties below are optional
         .instanceReusePolicy(InstanceReusePolicyProperty.builder()
                 .reuseOnScaleIn(false)
                 .build())
         .maxGroupPreparedCapacity(123)
         .minSize(123)
         .poolState("poolState")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnWarmPool

      protected CfnWarmPool(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnWarmPool

      protected CfnWarmPool(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnWarmPool

      @Stability(Stable) public CfnWarmPool(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnWarmPoolProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAutoScalingGroupName

      @Stability(Stable) @NotNull public String getAutoScalingGroupName()
      The name of the Auto Scaling group.
    • setAutoScalingGroupName

      @Stability(Stable) public void setAutoScalingGroupName(@NotNull String value)
      The name of the Auto Scaling group.
    • getInstanceReusePolicy

      @Stability(Stable) @Nullable public Object getInstanceReusePolicy()
      Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.
    • setInstanceReusePolicy

      @Stability(Stable) public void setInstanceReusePolicy(@Nullable IResolvable value)
      Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.
    • setInstanceReusePolicy

      @Stability(Stable) public void setInstanceReusePolicy(@Nullable CfnWarmPool.InstanceReusePolicyProperty value)
      Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.
    • getMaxGroupPreparedCapacity

      @Stability(Stable) @Nullable public Number getMaxGroupPreparedCapacity()
      Specifies 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.
    • setMaxGroupPreparedCapacity

      @Stability(Stable) public void setMaxGroupPreparedCapacity(@Nullable Number value)
      Specifies 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.
    • getMinSize

      @Stability(Stable) @Nullable public Number getMinSize()
      Specifies the minimum number of instances to maintain in the warm pool.
    • setMinSize

      @Stability(Stable) public void setMinSize(@Nullable Number value)
      Specifies the minimum number of instances to maintain in the warm pool.
    • getPoolState

      @Stability(Stable) @Nullable public String getPoolState()
      Sets the instance state to transition to after the lifecycle actions are complete.
    • setPoolState

      @Stability(Stable) public void setPoolState(@Nullable String value)
      Sets the instance state to transition to after the lifecycle actions are complete.