proxyable-nodejs-function
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Proxyable Nodejs Function (AWS-CDK)

Simple wrapper around @aws-cdk-lib NodejsFunction that configures an RDS proxy. See the unit test for an example of how to create the necessary resources.

import { Credentials, DatabaseInstance } from 'aws-cdk-lib/aws-rds';
import { Secret } from 'aws-cdk-lib/aws-secretsmanager';

import { Construct } from 'constructs';

import { ProxyableNodejsFunction } from '../src';

class MyStack extends cdk.Stack {

    constructor(scope: Construct, id: string, props?: cdk.StackProps) {
      super(scope, id, props);

      // Database, secret, and proxy setup...

      new ProxyableNodejsFunction(this, 'ProxiedFunction', {
        entry: join(__dirname, 'index.ts'),
        vpc,
        proxy,
        secret,
        database: 'test',
        username: 'testuser',
      });
    }
}

Dependencies (0)

    Dev Dependencies (23)

    Package Sidebar

    Install

    npm i proxyable-nodejs-function

    Weekly Downloads

    0

    Version

    0.0.2

    License

    Apache-2.0

    Unpacked Size

    202 kB

    Total Files

    9

    Last publish

    Collaborators

    • cachemonet