Creates a new instance of this lambda function.
(optional) a container name (accessible via ContextInfo)
(optional) a container description (accessible via ContextInfo)
The map of registered actions.
The default path to config file.
The performanc counters.
The dependency resolver.
The map of registred validation schemas.
Calls registered action in this lambda function. "cmd" parameter in the action parameters determin what action shall be called.
This method shall only be used in testing.
action parameters.
callback function that receives action result or error.
Gets entry point into this lambda function.
an incoming event object with invocation parameters.
a context object with local references.
Adds instrumentation to log calls and measure call time. It returns a Timing object that is used to end the time measurement.
(optional) transaction id to trace execution through call chain.
a method name.
Timing object to end the time measurement.
Registers all actions in this lambda function.
Registers an action in this lambda function.
a action/command name.
a validation schema to validate received parameters.
an action function that is called when action is invoked.
Runs this lambda function, loads container configuration, instantiate components and manage their lifecycle, makes this function ready to access action calls.
callback function that receives error or null for success.
Sets references to dependent components.
references to locate the component dependencies.
Generated using TypeDoc
Abstract AWS Lambda function, that acts as a container to instantiate and run components and expose them via external entry point. All actions are automatically generated for commands defined in ICommandable components. Each command is exposed as an action defined by "cmd" parameter.
Container configuration for this Lambda function is stored in
"./config/config.yml"
file. But this path can be overriden byCONFIG_PATH
environment variable.Configuration parameters
References
*:logger:*:*:1.0
(optional) ILogger components to pass log messages*:counters:*:*:1.0
(optional) ICounters components to pass collected measurements*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connection*:credential-store:*:*:1.0
(optional) Credential stores to resolve credentialsLambdaClient
Example
class MyLambdaFunction extends CommandableLambdaFunction { private _controller: IMyController; ... public constructor() { base("mygroup", "MyGroup lambda function"); this._dependencyResolver.put( "controller", new Descriptor("mygroup","controller","*","*","1.0") ); } } let lambda = new MyLambdaFunction(); service.run((err) => { console.log("MyLambdaFunction is started"); });