AutoScalingOptions Struct
Properties for enabling Lambda autoscaling.
Example
ts
import * as appscaling from 'aws-cdk-lib/aws-applicationautoscaling';
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: appscaling.Schedule.cron({ hour: '8', minute: '0'}),
minCapacity: 20,
});