interface UtilizationScalingOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Lambda.UtilizationScalingOptions |
![]() | software.amazon.awscdk.services.lambda.UtilizationScalingOptions |
![]() | aws_cdk.aws_lambda.UtilizationScalingOptions |
![]() | @aws-cdk/aws-lambda » UtilizationScalingOptions |
Options for enabling Lambda utilization tracking.
Example
import * as autoscaling from '@aws-cdk/aws-autoscaling';
declare const fn: lambda.Function;
const alias = fn.addAlias('prod');
// Create AutoScaling target
const as = alias.addAutoScaling({ maxCapacity: 50 });
// Configure Target Tracking
as.scaleOnUtilization({
utilizationTarget: 0.5,
});
// Configure Scheduled Scaling
as.scaleOnSchedule('ScaleUpInTheMorning', {
schedule: autoscaling.Schedule.cron({ hour: '8', minute: '0'}),
minCapacity: 20,
});
Properties
Name | Type | Description |
---|---|---|
utilization | number | Utilization target for the attribute. |
disable | boolean | Indicates whether scale in by the target tracking policy is disabled. |
policy | string | A name for the scaling policy. |
scale | Duration | Period after a scale in activity completes before another scale in activity can start. |
scale | Duration | Period after a scale out activity completes before another scale out activity can start. |
utilizationTarget
Type:
number
Utilization target for the attribute.
For example, .5 indicates that 50 percent of allocated provisioned concurrency is in use.
disableScaleIn?
Type:
boolean
(optional, default: false)
Indicates whether scale in by the target tracking policy is disabled.
If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.
policyName?
Type:
string
(optional, default: Automatically generated name.)
A name for the scaling policy.
scaleInCooldown?
Type:
Duration
(optional, default: Duration.seconds(300) for the following scalable targets: ECS services,
Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters,
Amazon SageMaker endpoint variants, Custom resources. For all other scalable
targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB
global secondary indexes, Amazon Comprehend document classification endpoints,
Lambda provisioned concurrency)
Period after a scale in activity completes before another scale in activity can start.
scaleOutCooldown?
Type:
Duration
(optional, default: Duration.seconds(300) for the following scalable targets: ECS services,
Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters,
Amazon SageMaker endpoint variants, Custom resources. For all other scalable
targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB
global secondary indexes, Amazon Comprehend document classification endpoints,
Lambda provisioned concurrency)
Period after a scale out activity completes before another scale out activity can start.