Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bytekast/algo-lambda
https://github.com/bytekast/algo-lambda
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bytekast/algo-lambda
- Owner: bytekast
- Created: 2019-10-05T23:36:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T14:55:53.000Z (almost 2 years ago)
- Last Synced: 2023-04-10T16:09:03.423Z (over 1 year ago)
- Language: JavaScript
- Size: 236 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless Component - Algorithmia Function Lambda Wrapper
This is a simple [Serverless Framework Component](https://serverless.com/components/) that creates a Lambda wrapper to an [Algorithmia](https://algorithmia.com) function. With a Lambda wrapper, an Algorithmia function can be triggered by AWS Events - such as SNS, SQS, etc.
1. [Install](#1-install)
2. [Usage](#2-usage)
3. [Deploy](#3-deploy)
### 1. Install
Install the [Serverless Framework](https://www.github.com/serverless/serverless):
```console
$ npm i -g serverless
```Add the access keys of an AWS IAM Role with `AdministratorAccess` in a `.env` file, using this format:
```bash
AWS_ACCESS_KEY_ID=1234
AWS_SECRET_ACCESS_KEY=1234
```Or, you can set these as environment variables manually before deploying.
### 2. Usage
Create a `serverless.yml` in an empty directory and add the following:
```yaml
name: demosummarizer:
component: 'algo-lambda'
inputs:
env:
apiKey: 'YOUR_ALGORITHMIA_API_KEY'
algorithm: 'nlp/Summarizer/0.1.8' # See Algorithmia marketplace
```In the same directory, create a `package.json` file with the following contents:
```json
{
"dependencies": {
"algo-lambda": "latest"
}
}
```Run `npm install`
See example [here](./examples/simple).
### 3. Deploy
Deploy via the `serverless` command:
```console
$ serverless
```Use the `--debug` flag if you'd like to learn what's happening behind the scenes:
```console
$ serverless --debug
```## New to Components?
Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.