Interface BasicTargetTrackingScalingPolicyProps
- All Superinterfaces:
BaseTargetTrackingProps
,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
TargetTrackingScalingPolicyProps
- All Known Implementing Classes:
BasicTargetTrackingScalingPolicyProps.Jsii$Proxy
,TargetTrackingScalingPolicyProps.Jsii$Proxy
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());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forBasicTargetTrackingScalingPolicyProps
static final class
An implementation forBasicTargetTrackingScalingPolicyProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default IMetric
A custom metric for application autoscaling.default PredefinedMetric
A predefined metric for application autoscaling.default String
Identify the resource associated with the metric type.The target value for the metric.Methods inherited from interface software.amazon.awscdk.services.applicationautoscaling.BaseTargetTrackingProps
getDisableScaleIn, getPolicyName, getScaleInCooldown, getScaleOutCooldown
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getTargetValue
The target value for the metric. -
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
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
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
-