Implement scheduled scaling
Recently, Amazon EventBridge Scheduler added 619 new SDK API actions. One of these actions adjusts the Lambda function's minimum and maximum execution environments for Lambda Managed Instances (LMI) on a recurring or one-time schedule. This is useful for predictable traffic patterns, such as scaling up before peak hours and scaling down during off-peak hours. We can use CloudFormation or the latest versions of AWS CDK or AWS CLI to perform this action. In our example, we'll use AWS CLI to adjust the Lambda Function Scaling Configuration, for which we'll use the PutFunctionScalingConfig API as a universal target. We'll use the Lambda function with the name GetProductByIdJava25WithLMI, which we introduced in part 1.
First of all, let's create an SQS dead-letter queue, which we'll use for our action:
aws sqs create-queue --queue-name scheduler-dlq
Enter fullscreen mode












