@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:41.387Z") public interface BasicTargetTrackingScalingPolicyProps extends BaseTargetTrackingProps
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());
Modifier and Type | Interface and Description |
---|---|
static class |
BasicTargetTrackingScalingPolicyProps.Builder
A builder for
BasicTargetTrackingScalingPolicyProps |
static class |
BasicTargetTrackingScalingPolicyProps.Jsii$Proxy
An implementation for
BasicTargetTrackingScalingPolicyProps |
Modifier and Type | Method and Description |
---|---|
static BasicTargetTrackingScalingPolicyProps.Builder |
builder() |
default IMetric |
getCustomMetric()
A custom metric for application autoscaling.
|
default PredefinedMetric |
getPredefinedMetric()
A predefined metric for application autoscaling.
|
default java.lang.String |
getResourceLabel()
Identify the resource associated with the metric type.
|
java.lang.Number |
getTargetValue()
The target value for the metric.
|
getDisableScaleIn, getPolicyName, getScaleInCooldown, getScaleOutCooldown
java.lang.Number getTargetValue()
default IMetric getCustomMetric()
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.
default PredefinedMetric getPredefinedMetric()
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.
default java.lang.String getResourceLabel()
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.
static BasicTargetTrackingScalingPolicyProps.Builder builder()
builder
in interface BaseTargetTrackingProps
BasicTargetTrackingScalingPolicyProps.Builder
of BasicTargetTrackingScalingPolicyProps