Skip to content

CDK app that deploys a Lambda function with dynamic provisioned concurrency and scales it based on the provisioned concurrency utilization

License

Notifications You must be signed in to change notification settings

garysassano/cdk-aws-lambda-dynamic-provisioned-concurrency

Repository files navigation

cdk-aws-lambda-dynamic-provisioned-concurrency

CDK app that deploys a Lambda function with dynamic provisioned concurrency and scales it based on the provisioned concurrency utilization.

Prerequisites

Installation

npx projen install

Deployment

npx projen deploy

Usage

  1. Grab the <LAMBDA_FUNCTION_URL> from the deployment outputs:

    Outputs:
    cdk-aws-lambda-dpc-basic-dev.ScalableFunctionAliasUrl = <LAMBDA_FUNCTION_URL>
  2. Install oha, a HTTP load testing tool, and put your Lambda function under stress:

    oha -q 10 -z 1m <LAMBDA_FUNCTION_URL>
  3. In AWS Console, Lambdascalable-functionAliaseslive:

    Lambda Alias Provisioned Concurrency

  4. 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.

Cleanup

npx projen destroy

Architecture Diagram

Architecture Diagram

About

CDK app that deploys a Lambda function with dynamic provisioned concurrency and scales it based on the provisioned concurrency utilization

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published