Class ScalableTaskCount
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.services.applicationautoscaling.BaseScalableAttribute
software.amazon.awscdk.services.ecs.ScalableTaskCount
- All Implemented Interfaces:
IConstruct,IDependable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.438Z")
@Stability(Stable)
public class ScalableTaskCount
extends BaseScalableAttribute
The scalable attribute representing task count.
Example:
Cluster cluster;
ApplicationLoadBalancedFargateService loadBalancedFargateService = ApplicationLoadBalancedFargateService.Builder.create(this, "Service")
.cluster(cluster)
.memoryLimitMiB(1024)
.desiredCount(1)
.cpu(512)
.taskImageOptions(ApplicationLoadBalancedTaskImageOptions.builder()
.image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
.build())
.build();
ScalableTaskCount scalableTarget = loadBalancedFargateService.service.autoScaleTaskCount(EnableScalingProps.builder()
.minCapacity(1)
.maxCapacity(20)
.build());
scalableTarget.scaleOnCpuUtilization("CpuScaling", CpuUtilizationScalingProps.builder()
.targetUtilizationPercent(50)
.build());
scalableTarget.scaleOnMemoryUtilization("MemoryScaling", MemoryUtilizationScalingProps.builder()
.targetUtilizationPercent(50)
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScalableTaskCount(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedScalableTaskCount(software.amazon.jsii.JsiiObjectRef objRef) ScalableTaskCount(software.constructs.Construct scope, String id, ScalableTaskCountProps props) Constructs a new instance of the ScalableTaskCount class. -
Method Summary
Modifier and TypeMethodDescriptionvoidScales in or out to achieve a target CPU utilization.voidScales in or out to achieve a target memory utilization.voidscaleOnMetric(String id, BasicStepScalingPolicyProps props) Scales in or out based on a specified metric value.voidscaleOnRequestCount(String id, RequestCountScalingProps props) Scales in or out to achieve a target Application Load Balancer request count per target.voidscaleOnSchedule(String id, ScalingSchedule props) Scales in or out based on a specified scheduled time.voidscaleToTrackCustomMetric(String id, TrackCustomMetricProps props) Scales in or out to achieve a target on a custom metric.Methods inherited from class software.amazon.awscdk.services.applicationautoscaling.BaseScalableAttribute
doScaleOnMetric, doScaleOnSchedule, doScaleToTrackMetric, getPropsMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
toStringMethods 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.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ScalableTaskCount
protected ScalableTaskCount(software.amazon.jsii.JsiiObjectRef objRef) -
ScalableTaskCount
protected ScalableTaskCount(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ScalableTaskCount
@Stability(Stable) public ScalableTaskCount(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ScalableTaskCountProps props) Constructs a new instance of the ScalableTaskCount class.- Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
scaleOnCpuUtilization
@Stability(Stable) public void scaleOnCpuUtilization(@NotNull String id, @NotNull CpuUtilizationScalingProps props) Scales in or out to achieve a target CPU utilization.- Parameters:
id- This parameter is required.props- This parameter is required.
-
scaleOnMemoryUtilization
@Stability(Stable) public void scaleOnMemoryUtilization(@NotNull String id, @NotNull MemoryUtilizationScalingProps props) Scales in or out to achieve a target memory utilization.- Parameters:
id- This parameter is required.props- This parameter is required.
-
scaleOnMetric
@Stability(Stable) public void scaleOnMetric(@NotNull String id, @NotNull BasicStepScalingPolicyProps props) Scales in or out based on a specified metric value.- Parameters:
id- This parameter is required.props- This parameter is required.
-
scaleOnRequestCount
@Stability(Stable) public void scaleOnRequestCount(@NotNull String id, @NotNull RequestCountScalingProps props) Scales in or out to achieve a target Application Load Balancer request count per target.- Parameters:
id- This parameter is required.props- This parameter is required.
-
scaleOnSchedule
Scales in or out based on a specified scheduled time.- Parameters:
id- This parameter is required.props- This parameter is required.
-
scaleToTrackCustomMetric
@Stability(Stable) public void scaleToTrackCustomMetric(@NotNull String id, @NotNull TrackCustomMetricProps props) Scales in or out to achieve a target on a custom metric.- Parameters:
id- This parameter is required.props- This parameter is required.
-