Class CfnWarmPool
- All Implemented Interfaces:
IInspectable
,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
UpdatePolicy
attribute for Auto Scaling groups. During an update, ifUpdatePolicy
is set toAutoScalingRollingUpdate
, CloudFormation replacesInService
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. IfUpdatePolicy
is 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
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnWarmPool
.static interface
A structure that specifies an instance reuse policy for theInstanceReusePolicy
property of the AWS::AutoScaling::WarmPool resource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnWarmPool
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnWarmPool
(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 exceptTerminated
for 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.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAutoScalingGroupName
(String value) The name of the Auto Scaling group.void
Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.void
Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in.void
Specifies the maximum number of instances that are allowed to be in the warm pool or in any state exceptTerminated
for the Auto Scaling group.void
setMinSize
(Number value) Specifies the minimum number of instances to maintain in the warm pool.void
setPoolState
(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, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
inspect
in 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:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
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. -
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 exceptTerminated
for the Auto Scaling group. -
setMaxGroupPreparedCapacity
Specifies the maximum number of instances that are allowed to be in the warm pool or in any state exceptTerminated
for 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.
-