1.0.4 • Published 1 year ago
@growsari/invoke-lambda v1.0.4
Invoke Lambda Package
Utility function for calling microservices within APIs.
Usage
const invokeLambda = require('@growsari/invoke-lambda')
await invokeLambda('ms-some-project', 'create', { name: 'some-name', description: 'some-value'})
You may specify the API version and the region as named parameters after params
. They will default to '2015-03-31'
and process.env.AWS_DEFAULT_REGION
respectively, if not defined.
Async
await invokeLambda('ms-some-project', 'create', { name: 'some-name', description: 'some-value'}, {async: true})
You can specify {async: true} to execute lambda asynchronously.
Details
Invokes the lambda named [service]-[stage]-[operation]
.
Assumptions
process.env.AWS_DEFAULT_REGION
is named in the project.process.env.IS_OFFLINE
istrue
when deployed.- When in offline mode, it is deployed through Docker deployment.
process.env[``${service.toUpperCase()}-PORT``]
is assigned to the deployment port of the specific service in the Docker deployment.- The containing lambda has access to all of the lambdas named.
- Called function response has the following payload format
{
data: Object,
success: Boolean,
message: String,
code: any
}
so that the response will be identified properly as a success or a failure.
Errors
Code | Message |
---|---|
INVOKE-001 | Invalid lambda function 'function_name' |
INVOKE-002 | Error executing lambda 'function_name' |
1.0.4
1 year ago
1.0.3
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago
0.0.21
4 years ago
0.0.20
5 years ago
0.0.19
5 years ago
0.0.18
5 years ago
0.0.17
5 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.10
5 years ago
0.0.11
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago