An open API service indexing awesome lists of open source software.

https://github.com/rimiti/node-lambda-functions

Node AWS lambda function project
https://github.com/rimiti/node-lambda-functions

aws lambda lambda-functions node

Last synced: 3 months ago
JSON representation

Node AWS lambda function project

Awesome Lists containing this project

README

          

# node-lambda-functions [![Dependency Status](https://www.versioneye.com/user/projects/595a15cb6725bd002f1b82bd/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/595a15cb6725bd002f1b82bd)

Create your own functions and upload them on AWS.

# Install
```
$ git clone https://github.com/rimiti/node-lambda-functions.git
```

## How it works ?
For each folder:
- Each folders present in `./src` directory is a lambda function.
- Each functions must have a `package.json` file with his all dependencies included.
- Each functions must have a `index.js` as entry point.
- Each functions must have a `test.js` to simulate a launch.
- Each functions must have a `json` as event object.

## Example

### usersCsvExport
Export SQL results in a csv file, send it by mail and saves file on S3.
The function triggers each event generated by Cloudwatch, which must be configured to send an event with the following json data:
```json
{
"query": "SELECT * FROM db.users",
"bucket": "users.export",
"filename": "exportUtilisateur",
"email": {
"from": "Dim Solution ",
"to": "dimitri.dobairro@dimsolution.com",
"cc": "contact@dimsolution.com",
"subject": "Export utilisateur",
"html": "

Hello,

Please find attached users export file.

This is an automatic email, please do not reply."
}
}
```

## Upload your function
```js
gulp deploy --functionName usersCsvExport
```

## Tag
```js
gulp tag:patch // Makes v0.1.0 → v0.1.1
gulp tag:feature // Makes v0.1.1 → v0.2.0
gulp tag:release // Makes v0.2.1 → v1.0.0
```

## Tests
```js
// Run tests
gulp mocha
```