Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hupe1980/cdk-lambda-code
Wrapper arroud @aws-cdk/aws-lambda Code to support mocking in test mode and configuration wtih package.json namespaces
https://github.com/hupe1980/cdk-lambda-code
aws cdk lambda
Last synced: about 1 month ago
JSON representation
Wrapper arroud @aws-cdk/aws-lambda Code to support mocking in test mode and configuration wtih package.json namespaces
- Host: GitHub
- URL: https://github.com/hupe1980/cdk-lambda-code
- Owner: hupe1980
- License: mit
- Created: 2019-12-18T14:16:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-19T23:52:59.000Z (almost 5 years ago)
- Last Synced: 2024-10-05T17:42:10.836Z (about 2 months ago)
- Topics: aws, cdk, lambda
- Language: TypeScript
- Size: 170 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cdk-lambda-code
[![Build Status](https://travis-ci.org/hupe1980/cdk-lambda-code.svg?branch=master)](https://travis-ci.org/hupe1980/cdk-lambda-code)
> 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
```sh
// with npm
npm install cdk-lambda-code// with yarn
yarn add cdk-lambda-code
```## How to use `fromPackageJson`
```json
// package.json{
"name": "construct",
"lambdaDependencies": {
"lambdaHandler": {
"runtime": "nodejs10.x",
"handler": "lib/index.handler",
"artifact": "lambda/bundle.zip"
}
}
}
``````typescript
// smaple-construct.ts
import { LambdaCode } from 'cdk-lambda-code';new Function(this, 'LambdaFunction', {
...LambdaCode.fromPackageJson('lambdaHandler', {
cwd: __dirname,
mockInTestMode: true
})
});
```## How to use `fromFileAsInline`
```typescript
// 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](LICENSE)