Class TargetTrackingScalingPolicy

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.TargetTrackingScalingPolicy
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-12T17:54:16.421Z") @Stability(Stable) public class TargetTrackingScalingPolicy extends software.amazon.jsii.JsiiObject
A target tracking scaling policy that automatically adjusts the capacity provider's compute resources to maintain a specified target value by tracking the required CloudWatch metric.

Example:

 import software.amazon.awscdk.services.ec2.*;
 Vpc vpc = new Vpc(this, "MyVpc");
 SecurityGroup securityGroup = SecurityGroup.Builder.create(this, "SecurityGroup").vpc(vpc).build();
 CapacityProvider capacityProvider = CapacityProvider.Builder.create(this, "MyCapacityProvider")
         .subnets(vpc.getPrivateSubnets())
         .securityGroups(List.of(securityGroup))
         .scalingOptions(ScalingOptions.manual(List.of(TargetTrackingScalingPolicy.cpuUtilization(70))))
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    TargetTrackingScalingPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    TargetTrackingScalingPolicy(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    cpuUtilization(Number targetCpuUtilization)
    Creates a target tracking scaling policy for CPU utilization.
    The predefined metric type.
    The predefined metric type for this scaling policy.
    The target value for the specified metric as a percentage.
    The target value for the metric.

    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, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • TargetTrackingScalingPolicy

      protected TargetTrackingScalingPolicy(software.amazon.jsii.JsiiObjectRef objRef)
    • TargetTrackingScalingPolicy

      protected TargetTrackingScalingPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • cpuUtilization

      @Stability(Stable) @NotNull public static TargetTrackingScalingPolicy cpuUtilization(@NotNull Number targetCpuUtilization)
      Creates a target tracking scaling policy for CPU utilization.

      Parameters:
      targetCpuUtilization - The target value for CPU utilization. This parameter is required.
    • getMetricType

      @Stability(Stable) @NotNull public String getMetricType()
      The predefined metric type.
    • getPredefinedMetricType

      @Stability(Stable) @NotNull public String getPredefinedMetricType()
      The predefined metric type for this scaling policy.
    • getTargetValue

      @Stability(Stable) @NotNull public Number getTargetValue()
      The target value for the specified metric as a percentage.

      The capacity provider will scale resources to maintain this target value.

    • getValue

      @Stability(Stable) @NotNull public Number getValue()
      The target value for the metric.