Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garysassano/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
https://github.com/garysassano/cdk-aws-lambda-dynamic-provisioned-concurrency
application-auto-scaling aws aws-cdk aws-cdk-typescript aws-lambda awscdk awscdk-ts cdk cdk-ts dynamic-provisioned-concurrency lambda lambda-provisioned-concurrency provisioned-concurrency typescript
Last synced: about 1 month ago
JSON representation
CDK app that deploys a Lambda function with dynamic provisioned concurrency and scales it based on the provisioned concurrency utilization
- Host: GitHub
- URL: https://github.com/garysassano/cdk-aws-lambda-dynamic-provisioned-concurrency
- Owner: garysassano
- License: apache-2.0
- Created: 2024-06-09T01:06:01.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-21T09:54:27.000Z (6 months ago)
- Last Synced: 2024-07-21T10:57:56.719Z (6 months ago)
- Topics: application-auto-scaling, aws, aws-cdk, aws-cdk-typescript, aws-lambda, awscdk, awscdk-ts, cdk, cdk-ts, dynamic-provisioned-concurrency, lambda, lambda-provisioned-concurrency, provisioned-concurrency, typescript
- Language: TypeScript
- Homepage:
- Size: 221 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
- **_AWS:_**
- Must have authenticated with [Default Credentials](https://docs.aws.amazon.com/cdk/v2/guide/cli.html#cli_auth) in your local environment.
- Must have completed the [CDK bootstrapping](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html) for the target AWS environment.
- **_Node.js + npm:_**
- Must be [installed](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) in your system.## Installation
```sh
npx projen install
```## Deployment
```sh
npx projen deploy
```## Usage
1. Grab the `` from the deployment outputs:
```sh
Outputs:
cdk-aws-lambda-dpc-basic-dev.ScalableFunctionAliasUrl =
```2. [Install oha](https://github.com/hatoo/oha?tab=readme-ov-file#installation), a HTTP load testing tool, and put your Lambda function under stress:
```sh
oha -q 10 -z 1m
```3. In AWS Console, `Lambda` ➜ `scalable-function` ➜ `Aliases` ➜ `live`:
![Lambda Alias Provisioned Concurrency](./src/assets/lambda-alias-pc.png)
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
```sh
npx projen destroy
```## Architecture Diagram
![Architecture Diagram](./src/assets/arch.svg)