You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a Ballerina Service as a Serverless function in AWS Lambda
This project implements an AWS Request Handler, which is triggered by AWS Lambda when there is an event.
The request handler invokes the Ballerina Service resource and returns the response.
The Ballerina service is compiled using an unofficial API in the constructor.
The handler method locates the service resource in the compiled Ballerina service and executes it programmatically.
How to run your own Ballerina service in AWS Lambda
Clone the ballerina-lambda repository.
git clone https://github.com/chrishantha/ballerina-lambda --depth=1
cd ballerina-lambda/
Save ballerina service in ballerina-services directory. Currently, the ballerina-lambda expects a ballerina
package name, which includes the Ballerina service. Therefore, you need to make sure that the ballerina
service is in a package. There is already a sample helloWorldService inside the ballerina-services directory.
Now build the maven project.
mvn clean package
There should be a zip file inside the target directory.
Use the zip file as the package for AWS Lambda function.
Following must be specified as the handler method.