typescript-aws-lambda-helper
v2.0.48
Published
Typescript AWS Lambda Helper
Downloads
84
Maintainers
Readme
Typescript helper functions for AWS Lambda service
Install
npm install typescript-aws-lambda-helper@latest
Usage
Default - running in Lambda in your own account
const logger = new Logger(LogLevel.Trace);
const helper = new LambdaHelper(logger);
const response = await helper.InvokeAsync('lambdaName', 'payload');
Running in separate account or not in Lambda
import * as Lambda from '@aws-sdk/client-lambda';
const logger = new Logger(LogLevel.Trace);
const options: Lambda.LambdaClientConfig = {
accessKeyId: '{access_key}',
secretAccessKey: '{secret_key}',
region: 'us-east-1',
};
const repository = new Lambda.Lambda(options);
const helper = new LambdaHelper(logger, repository);
const response = await helper.InvokeAsync('lambdaName', 'payload');
Notes
If no options are supplied, will default to us-east-1
as the region
Development
Clone the latest and run
npm run prep
to install packages and prep the git hooks