0.2.0 • Published 4 years ago

cdk-lambda-code v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

cdk-lambda-code

Build Status

Wrapper arroud @aws-cdk/aws-lambda Code to support mocking in test mode and configuration wtih package.json namespaces

:warning: This is experimental and subject to breaking changes.

Install

// with npm
npm install cdk-lambda-code

// with yarn
yarn add cdk-lambda-code

How to use fromPackageJson

// package.json

{
  "name": "construct",
  "lambdaDependencies": {
    "lambdaHandler": {
      "runtime": "nodejs10.x",
      "handler": "lib/index.handler",
      "artifact": "lambda/bundle.zip"
    }
  }
}
// smaple-construct.ts
import { LambdaCode } from 'cdk-lambda-code';

new Function(this, 'LambdaFunction', {
  ...LambdaCode.fromPackageJson('lambdaHandler', {
    cwd: __dirname,
    mockInTestMode: true
  })
});

How to use fromFileAsInline

// smaple-construct.ts
import { LambdaCode } from 'cdk-lambda-code';

new Function(this, 'LambdaFunction', {
  code: LambdaCode.fromFileAsInline(path.join(__dirname, '..', 'handler.js'))
  runtime: Runtime.NODEJS_10_X,
  handler: 'index.handler'
});

License

MIT

0.2.0

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.14

4 years ago