CommandableLambdaFunction

Abstract AWS Lambda function that acts as a container to instantiate and run components and expose them via an external entry point.

Inherits: LambdaFunction

Description

The CommandableLambdaFunction class allows you to create AWS Lambda function that acts as a container to instantiate and run components and expose them via an external entry point.

Important points

  • All actions are automatically generated for commands defined in ICommandable components. Each command is exposed as an action defined by the “cmd” parameter.

  • Container configuration for this Lambda function is stored in "./config/config.yml" file. But this path can be overriden by CONFIG_PATH environment variable.

  • Note: This component has been deprecated. Use LambdaService instead.

References

  • *:logger:*:*:1.0: (optional) ILogger components to pass log messages.
  • *:counters:*:*:1.0: (optional) ICounters components to pass collected measurements.
  • *:service:lambda:*:1.0: (optional) ILambdaService services to handle action requests
  • *:service:commandable-lambda:*:1.0: (optional) ILambdaService services to handle action requests

Constructors

Creates a new instance of this lambda function.

public CommandableLambdaFunction(string name, string description)

  • name: string - (optional) container name (accessible via ContextInfo).
  • description: string - (optional) container description (accessible via ContextInfo).

Instance methods

Register

Registers all actions in this lambda function.

public void Register()

Examples

class MyLambdaFunction: CommandableLambdaFunction {
    private IMyController _controller;
    ...
    public MyLambdaFunction() : base("mygroup", "MyGroup lambda function")
    {
        this._dependencyResolver.Put(
            "controller",
            new Descriptor("mygroup", "controller", "*", "*", "1.0")
        );
    }
}
var lambda = new MyLambdaFunction();

await service.RunAsync();
Console.WriteLine("MyLambdaFunction is started");

See also