0.4.2 • Published 2 years ago
@1mill/lambda v0.4.2
lambda
Simple wrapper around the @aws-sdk/client-lambda
library to invoke AWS Lambda functions with Cloudevents.
Usage
Node
<script src="https://unpkg.com/@1mill/lambda@0.4/dist/index.umd.js"></script>
or
npm install @1mill/lambda
const { Lambda } = require('@1mill/lambda') // CommonJS
import { Lambda } from '@1mill/lambda' // EMS
const lambda = new Lambda({
accessKeyId: 'required' || process.env.MILL_LAMBDA_AWS_ACCESS_KEY_ID,
endpoint: 'optional' || process.env.MILL_LAMBDA_AWS_ENDPOINT,
region: 'required' || process.env.MILL_LAMBDA_AWS_REGION,
secretAccessKey: 'required' || process.env.MILL_LAMBDA_AWS_SECRET_ACCESS_KEY,
sessionToken: 'optional' || process.env.AWS_SESSION_TOKEN,
})
Required | Default | Notes | |||||
---|---|---|---|---|---|---|---|
accessKeyId | yes | process.env.MILL_LAMBDA_AWS_ACCESS_KEY_ID | process.env.AWS_ACCESS_KEY_ID | process.env.AWS_ACCESS_KEY | |||
endpoint | process.env.MILL_LAMBDA_AWS_ENDPOINT | process.env.AWS_ENDPOINT | Good for local development environment when using Localstack (or other AWS simulators) | ||||
region | yes | process.env.MILL_LAMBDA_AWS_REGION | process.env.AWS_REGION | ||||
secretAccessKey | yes | process.env.MILL_LAMBDA_AWS_SECRET_ACCESS_KEY | process.env.AWS_SECRET_ACCESS_KEY | ||||
sessionToken | process.env.AWS_SESSION_TOKEN |
const lambda = new Lambda({...})
await lambda.invoke({
cloudevent,
functionName: 'required-my-lambda-arn',
invocationType: 'optional' || 'Event',
})
Required | Default | Notes | |
---|---|---|---|
cloudevent | yes | @1mill/cloudevents | |
functionName | yes | ||
invocationType | 'Event' | Options are 'Event' or 'RequestResponse' |
0.4.1
2 years ago
0.4.2
2 years ago
0.4.0
2 years ago
0.3.4
2 years ago
0.3.2
3 years ago
0.3.1
3 years ago
0.3.3
3 years ago
0.3.0
3 years ago
0.2.0
3 years ago
0.0.14
3 years ago
0.1.0
3 years ago
0.1.1
3 years ago
0.0.10
3 years ago
0.0.11
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago