Creating and Configuring Lambda Functions
This documentation is for Kyvos 2026.8.x. To view documentation for other Kyvos versions, click here. |
|---|
Overview
This section describes how to create and configure AWS Lambda functions used by Kyvos to manage operations, such as scheduled start, forced start, and displaying cluster status in the Kyvos Web Portal.
AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you.
Kyvos uses Lambda to start the analytical server instances. The CloudFormation template creates three Lambda functions for:
Scheduled start of the analytical server
Forced start of the analytical server
Display cluster status on the Kyvos Web UI
You can use your externally created Lambda functions with Kyvos. Use any of the following methods to create and configure the external Lambda functions.
On this page:
Using CloudFormation Template
The process for creating the Lambda functions remains the same for all three functions, except for step 4.
To manually create lambda functions, perform the following steps.
Go to the AWS Console and click Create Function.
On the Create Function page, click the Create Function button, and open the newly created function to configure it.
In Code Source, click Upload from and choose Amazon S3 Location.
Enter the S3 link URL of lambda.jar in the following format:
https://s3.amazonaws.com/{bucket-name}/{folder-name}/latest/kyvoslambda.jar
Example: https://s3.amazonaws.com/us-east-1.kyvos/2021.1/latest/kyvoslambda.jar
In Runtime settings, click Edit and change the Handler. Use the below handlers for the respective functions.
Semantic data model function: kyvos.elasticity.lambda.KyvosEC2LambdaHandler::handleRequest
Start function: kyvos.elasticity.lambda.KyvosServiceLambdaHandler::handleRequest
Status function: kyvos.elasticity.lambda.KyvosClusterLambda::handleRequest
Click General configuration > Edit and change the timeout to 15 minutes.
In Environment Variables, use the following Key and Value format:
BUCKET={Name of the bucket used in Kyvos}
REGION={Name of the region in which Kyvos EC2 instances are deployed)
WORK_DIR=(Name of the work directory used at the time of Kyvos deployment)
Note: The keys entered above are case-sensitive.
In Tags, use the following Key-Value pair:
ROLE= KYVOS_LAMBDA
UsedBy= Kyvos
LAYER= SCALE_LAYER
Configuring Lambda functions
In the kyvosclient.properties file, configure the following properties:
SERVER_STATUS_CHECK_URL
CLUSTER_STARTUP_URL
In the cluster.properties file located on S3 (${BUCKET_NAME}${WORK_DIR}/cloud_conf/cluster.properties), update the following properties:
LAMBDA_NAME
LAMBDA_ARN
OE_SCHEDULE_RULE
If you have created Lambda using your custom stack, take the values of these properties from stack Outputs as mentioned below:
EC2LambdaName in LAMBDA_NAME
EC2LambdaArn in LAMBDA_ARN
EventRuleID in OE_SCHEDULE_RULE
Configure the value of the below output keys in respective configuration properties
ServerStatusCheckUrl in SERVER_STATUS_CHECK_URL
ClusterStartUrl in CLUSTER_STARTUP_URL
If not created in the stack, then use the following values by replacing parameters in it with appropriate values.
SERVER_STATUS_CHECK_URL: https://${ID-OF-API-GATEWAY}.execute-api.${AWS::Region}.amazonaws.com/kyvosclusterstatus/
CLUSTER_STARTUP_URL: https://${ID-OF-API-GATEWAY}.execute-api.${AWS::Region}.amazonaws.com/kyvosclusterstart/
Take the Lambda function details (for the following properties) from the corresponding Lambda function. Take the value for NAME, ARN, and Event rule value from Triggers configuration of Lambda as mentioned in your CloudWatch rule of Event Bridge.
LAMBDA_NAME
LAMBDA_ARN
OE_SCHEDULE_RULE
Using Create Functions on AWS
Login to the AWS CloudFormation portal.
Create functions through the CloudFormation using lambda.json template file available at kyvosmanager_war/kyvosmanager/cloud/azure/templates. You can also download the file from the AWS Installation Files folder.
If the cluster is deployed with Deploy with Enhanced security option, then use the lambda_secure.json file available at the same location.
Step 1: Specify template
In the Prerequisite - Prepare template, select the Template is ready option.
In the Specify template, select the Upload a template file option to upload your lambda.json template using the Choose File button.
Click NEXT.
Step 2: Specify stack details
Enter a Stack name. Stack name can contain letters (A-Z and a-z), numbers (0-9), and dashes (-). The Kyvos cluster will be deployed in this name, and you cannot edit the name after deployment.
The Parameters area displays the configurations defined in your template. It also allows you to enter custom values to create or update a stack.
Enter details as:
Parameter | Description |
|---|---|
S3 Configuration | Enter the name of the S3 bucket to be used for storing Kyvos semantic models |
IAM Roles Configurations | Enter the name of the IAM Role that will be attached to the Lambda functions. If blank, the role will be created automatically. |
Kyvos Configurations | KyvosWorkDir: Enter the work directory path to be used by Kyvos. |
Network Configurations |
|
Click Next. The functions are created and displayed on the Outputs page. You can provide the name of these functions while deploying the cluster through the Kyvos Manager Wizard.