Integration and Deployment

Serverless Deployment

AWS Lambda Function

OpenRules generates the required AWS components and turns a tested decision model into a serverless function from the supplied deployment script.

One-click deployment

Move from a tested model to Lambda without coding.

The sample project VacationDaysLambda reuses the tested Vacation Days rule repository and adds project.properties, deployLambda.bat, and undeployLambda.bat. On macOS or Linux, use the corresponding scripts without the .bat suffix.

Before deploying, use an active AWS account and configure the AWS access key ID and secret access key in ~/.aws/credentials.

OpenRules one-click deployment to AWS Lambda
One-click AWS Lambda deploymentOpen full size ↗

Configuration

Control the Lambda from project properties.

Define the AWS deployment properties in project.properties. The required settings and their purposes are shown below.

deployment=aws-lambdaSelects AWS Lambda as the deployment option.
aws.lambda.bucket=openrules-demo-lambda-bucketDefines a new or existing S3 bucket, such as your-company-lambda-bucket.
aws.lambda.region=us-east-1Defines the selected AWS region.
aws.lambda.runtime=java17Defines the Java runtime. Supported values are java17 (default) and java21.
aws.lambda.memorySize=512Defines the memory available to the Lambda function in MB. The default is 512.
aws.lambda.timeout=30Defines the maximum execution time in seconds. The default is 30 seconds.

Deploy and test

Use the generated endpoint immediately.

Run deployLambda.bat. The deployment log provides an invoke URL whose endpoint is derived from the model name and can be overridden with model.endpoint. OpenRules also generates testLambda.bat with the URL already included.

The first request may show an AWS cold start; later hot-start requests normally execute much faster. You can also test the endpoint with POSTMAN using any JSON test generated in the project’s jsons folder.

AWS Lambda deployment console with generated invoke URL
Generated Lambda invoke URLOpen full size ↗
AWS Lambda cold-start test output
First request: Lambda cold startOpen full size ↗
AWS Lambda hot-start test output
Repeated request: Lambda hot startOpen full size ↗
POSTMAN request to the deployed Vacation Days Lambda
Testing the Lambda with POSTMANOpen full size ↗

Application integration

Invoke the Lambda from Java or a CI/CD pipeline.

The included SampleGeneratedClient demonstrates a Java invocation. For an existing pipeline, use buildLambda.bat to package the Lambda code as a ZIP file for upload by your IT process.

To deploy another model, copy the Lambda project files, add the openrules-aws dependency to Maven, adjust the properties, and deploy. Run undeployLambda.bat when you want OpenRules to remove the deployed service and related AWS resources.

Java client for the deployed AWS Lambda decision service
Generated Java clientOpen full size ↗

Build and deploy

Try these deployment projects yourself.

The free evaluation includes ready-to-run decision models that you can build, test, and adapt.