Class CfnWarmPool
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,IWarmPoolRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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
UpdatePolicyattribute for Auto Scaling groups. During an update, ifUpdatePolicyis set toAutoScalingRollingUpdate, CloudFormation replacesInServiceinstances 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. IfUpdatePolicyis set toAutoScalingReplacingUpdate, 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnWarmPool.static interfaceA structure that specifies an instance reuse policy for theInstanceReusePolicyproperty of the AWS::AutoScaling::WarmPool resource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.autoscaling.IWarmPoolRef
IWarmPoolRef.Jsii$Default, IWarmPoolRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnWarmPool(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnWarmPool(software.amazon.jsii.JsiiObjectRef objRef) CfnWarmPool(software.constructs.Construct scope, String id, CfnWarmPoolProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe name of the Auto Scaling group.Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.Specifies the maximum number of instances that are allowed to be in the warm pool or in any state exceptTerminatedfor the Auto Scaling group.Specifies the minimum number of instances to maintain in the warm pool.Sets the instance state to transition to after the lifecycle actions are complete.A reference to a WarmPool resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAutoScalingGroupName(String value) The name of the Auto Scaling group.voidIndicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.voidIndicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.voidSpecifies the maximum number of instances that are allowed to be in the warm pool or in any state exceptTerminatedfor the Auto Scaling group.voidsetMinSize(Number value) Specifies the minimum number of instances to maintain in the warm pool.voidsetPoolState(String value) Sets the instance state to transition to after the lifecycle actions are complete.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getWarmPoolRef
A reference to a WarmPool resource.- Specified by:
getWarmPoolRefin interfaceIWarmPoolRef
-
getAutoScalingGroupName
The name of the Auto Scaling group. -
setAutoScalingGroupName
The name of the Auto Scaling group. -
getInstanceReusePolicy
Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.Returns union: either
IResolvableorCfnWarmPool.InstanceReusePolicyProperty -
setInstanceReusePolicy
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
Specifies the maximum number of instances that are allowed to be in the warm pool or in any state exceptTerminatedfor the Auto Scaling group. -
setMaxGroupPreparedCapacity
Specifies the maximum number of instances that are allowed to be in the warm pool or in any state exceptTerminatedfor the Auto Scaling group. -
getMinSize
Specifies the minimum number of instances to maintain in the warm pool. -
setMinSize
Specifies the minimum number of instances to maintain in the warm pool. -
getPoolState
Sets the instance state to transition to after the lifecycle actions are complete. -
setPoolState
Sets the instance state to transition to after the lifecycle actions are complete.
-