interface AutoScalingOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Lambda.AutoScalingOptions |
![]() | software.amazon.awscdk.services.lambda.AutoScalingOptions |
![]() | aws_cdk.aws_lambda.AutoScalingOptions |
![]() | @aws-cdk/aws-lambda » AutoScalingOptions |
Properties for enabling Lambda autoscaling.
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 |
---|---|---|
max | number | Maximum capacity to scale to. |
min | number | Minimum capacity to scale to. |
maxCapacity
Type:
number
Maximum capacity to scale to.
minCapacity?
Type:
number
(optional, default: 1)
Minimum capacity to scale to.