Interface BasicTargetTrackingScalingPolicyProps

All Superinterfaces:
BaseTargetTrackingProps, software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
TargetTrackingScalingPolicyProps
All Known Implementing Classes:
BasicTargetTrackingScalingPolicyProps.Jsii$Proxy, TargetTrackingScalingPolicyProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:37.325Z") @Stability(Stable) public interface BasicTargetTrackingScalingPolicyProps extends software.amazon.jsii.JsiiSerializable, BaseTargetTrackingProps
Properties for a Target Tracking policy that include the metric but exclude the target.

Example:

 import software.amazon.awscdk.services.lambda.*;
 Code code;
 Function handler = Function.Builder.create(this, "MyFunction")
         .runtime(Runtime.PYTHON_3_7)
         .handler("index.handler")
         .code(code)
         .reservedConcurrentExecutions(2)
         .build();
 Version fnVer = handler.getCurrentVersion();
 ScalableTarget target = ScalableTarget.Builder.create(this, "ScalableTarget")
         .serviceNamespace(ServiceNamespace.LAMBDA)
         .maxCapacity(100)
         .minCapacity(10)
         .resourceId(String.format("function:%s:%s", handler.getFunctionName(), fnVer.getVersion()))
         .scalableDimension("lambda:function:ProvisionedConcurrency")
         .build();
 target.scaleToTrackMetric("PceTracking", BasicTargetTrackingScalingPolicyProps.builder()
         .targetValue(0.9)
         .predefinedMetric(PredefinedMetric.LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION)
         .build());
 
  • Method Details

    • getTargetValue

      @Stability(Stable) @NotNull Number getTargetValue()
      The target value for the metric.
    • getCustomMetric

      @Stability(Stable) @Nullable default IMetric getCustomMetric()
      A custom metric for application autoscaling.

      The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.

      Exactly one of customMetric or predefinedMetric must be specified.

      Default: - No custom metric.

    • getPredefinedMetric

      @Stability(Stable) @Nullable default PredefinedMetric getPredefinedMetric()
      A predefined metric for application autoscaling.

      The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.

      Exactly one of customMetric or predefinedMetric must be specified.

      Default: - No predefined metrics.

    • getResourceLabel

      @Stability(Stable) @Nullable default String getResourceLabel()
      Identify the resource associated with the metric type.

      Only used for predefined metric ALBRequestCountPerTarget.

      Example value: app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>

      Default: - No resource label.

    • builder

      @Stability(Stable) static BasicTargetTrackingScalingPolicyProps.Builder builder()
      Returns:
      a BasicTargetTrackingScalingPolicyProps.Builder of BasicTargetTrackingScalingPolicyProps