CDK app that deploys a Lambda function with dynamic provisioned concurrency and scales it based on the provisioned concurrency utilization.
- AWS:
- Must have authenticated with Default Credentials in your local environment.
- Must have completed the CDK bootstrapping for the target AWS environment.
- Node.js + npm:
- Must be installed in your system.
npx projen install
npx projen deploy
-
Grab the
<LAMBDA_FUNCTION_URL>
from the deployment outputs:Outputs: cdk-aws-lambda-dpc-basic-dev.ScalableFunctionAliasUrl = <LAMBDA_FUNCTION_URL>
-
Install oha, a HTTP load testing tool, and put your Lambda function under stress:
oha -q 10 -z 1m <LAMBDA_FUNCTION_URL>
-
In AWS Console,
Lambda
➜scalable-function
➜Aliases
➜live
: -
Keep monitoring the
Provisioned concurrency
tab of the Lambda function alias. After around three minutes, you should see it scaling up from 1 to 2 or more as a result of the load increase.
npx projen destroy