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.
Adds a factory to the container. The factory is used to create components added to the container by their locators (descriptors).
a component factory to be added.
Stops the container by unsetting references for child containers and closing (+ dereferencing) the container's components.
unique business transaction id to trace calls across components.
(optional) the function to call when the closing process is complete. It will be called with an error if one is raised.
Creates a [[ContainerConfig]] from the passed ConfigParams, which is used to configure the components of this container.
the ConfigParams to configure the container with.
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.
whether or not any references have been set in this container.
Starts the container by setting references to components (in accordance with the container's configuration), setting child containers' references, and opening all referenced components.
If a custom "context-info" Descriptor is present in the set references, it will also be set.
unique business transaction id to trace calls across components.
(optional) the function to call when the opening process is complete. It will be called with an error if one is raised. If omitted, errors will be thrown by this method.
Reads JSON/YAML data from the target file to this container's [[ContainerConfig]].
unique business transaction id to trace calls across components.
the path to the target file, containing configuration parameters.
Must not be null
.
used to parameterize the ConfigReader.
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.
Method that should be overriden in child classes (child containers). Should unset the child containers' component references.
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"); });