Class ScalableTaskCount

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
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());
 
  • 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

      @Stability(Stable) public void scaleOnSchedule(@NotNull String id, @NotNull ScalingSchedule props)
      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.