Interface AddCapacityOptions
- All Superinterfaces:
AddAutoScalingGroupCapacityOptions,CommonAutoScalingGroupProps,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AddCapacityOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:38.638Z")
@Stability(Stable)
public interface AddCapacityOptions
extends software.amazon.jsii.JsiiSerializable, AddAutoScalingGroupCapacityOptions, CommonAutoScalingGroupProps
The properties for adding instance capacity to an AutoScalingGroup.
Example:
Cluster cluster;
cluster.addCapacity("graviton-cluster", AddCapacityOptions.builder()
.minCapacity(2)
.instanceType(new InstanceType("c6g.large"))
.machineImage(EcsOptimizedImage.amazonLinux2(AmiHardwareType.ARM))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAddCapacityOptionsstatic final classAn implementation forAddCapacityOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic AddCapacityOptions.Builderbuilder()The EC2 instance type to use when launching instances into the AutoScalingGroup.default IMachineImageThe ECS-optimized AMI variant to use.Methods inherited from interface software.amazon.awscdk.services.ecs.AddAutoScalingGroupCapacityOptions
getCanContainersAccessInstanceRole, getMachineImageType, getSpotInstanceDraining, getTopicEncryptionKeyMethods inherited from interface software.amazon.awscdk.services.autoscaling.CommonAutoScalingGroupProps
getAllowAllOutbound, getAssociatePublicIpAddress, getAutoScalingGroupName, getAzCapacityDistributionStrategy, getBlockDevices, getCapacityRebalance, getCooldown, getDefaultInstanceWarmup, getDesiredCapacity, getGroupMetrics, getHealthCheck, getHealthChecks, getIgnoreUnmodifiedSizeProperties, getInstanceMonitoring, getKeyName, getKeyPair, getMaxCapacity, getMaxInstanceLifetime, getMinCapacity, getNewInstancesProtectedFromScaleIn, getNotifications, getSignals, getSpotPrice, getSsmSessionPermissions, getTerminationPolicies, getTerminationPolicyCustomLambdaFunctionArn, getUpdatePolicy, getVpcSubnetsMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getInstanceType
The EC2 instance type to use when launching instances into the AutoScalingGroup. -
getMachineImage
The ECS-optimized AMI variant to use.The default is to use an ECS-optimized AMI of Amazon Linux 2 which is automatically updated to the latest version on every deployment. This will replace the instances in the AutoScalingGroup. Make sure you have not disabled task draining, to avoid downtime when the AMI updates.
To use an image that does not update on every deployment, pass:
EcsOptimizedImage machineImage = EcsOptimizedImage.amazonLinux2(AmiHardwareType.STANDARD, EcsOptimizedImageOptions.builder() .cachedInContext(true) .build());For more information, see Amazon ECS-optimized AMIs.
You must define either
machineImageormachineImageType, not both.Default: - Automatically updated, ECS-optimized Amazon Linux 2
-
builder
- Returns:
- a
AddCapacityOptions.BuilderofAddCapacityOptions
-