Lambda
Kubemq aws-lambda target connector allows services using kubemq server to access aws lambda service.

Prerequisites

The following required to run the aws-lambda target connector:
  • kubemq cluster
  • aws account with lambda active service
  • kubemq-source deployment

Configuration

lambda target connector configuration properties:
Properties Key
Required
Description
Example
aws_key
yes
aws key
aws key supplied by aws
aws_secret_key
yes
aws secret key
aws secret key supplied by aws
region
yes
region
aws region
token
no
aws token ("default" empty string
aws token
Example:
1
bindings:
2
- name: kubemq-query-aws-lambda
3
source:
4
kind: kubemq.query
5
name: kubemq-query
6
properties:
7
address: "kubemq-cluster:50000"
8
client_id: "kubemq-query-aws-lambda-connector"
9
auth_token: ""
10
channel: "query.aws.lambda"
11
group: ""
12
auto_reconnect: "true"
13
reconnect_interval_seconds: "1"
14
max_reconnects: "0"
15
target:
16
kind: aws.lambda
17
name: aws-lambda
18
properties:
19
aws_key: "id"
20
aws_secret_key: 'json'
21
region: "region"
22
token: ""
Copied!

Usage

List Lambda

List all lambdas
List Lambda:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"list"
Example:
1
{
2
"metadata": {
3
"method": "list"
4
},
5
"data": null
6
}
Copied!

Create Lambda

create a new lambda.
Create Lambda:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"create"
zip_file_name
yes
name of the zip file
"file.zip"
handler_name
yes
lambda handler name
"handler-path"
role
yes
aws role name
"arn:aws:iam::0000000:myRole"
function_name
yes
lambda function name
string
data
yes
the function code , in byte array
byte array
memory_size
no
memory_size needed default of 256
int
timeout
no
timeout set for task default of 15 (seconds)
int
description
no
function description default of ""
string
Example:
1
{
2
"metadata": {
3
"method": "create",
4
"zip_file_name": "myfile.zip",
5
"handler_name": "myhandler",
6
"role": "arn:aws:iam::0000000:myRole",
7
"runtime": "nodejs12.x",
8
"function_name": "testfunction",
9
"memory_size": "256",
10
"timeout": "3",
11
"description": "my awesome testing method"
12
},
13
"data": "ZXhwb3J0cy5oYW5kbGVyID0gYXN5bmMgKGV2ZW50KSA9PiB7CiAgICAvLyBUT0RPIGltcGxlbWVudAogICAgY29uc3QgcmVzcG9uc2UgPSB7CiAgICAgICAgc3RhdHVzQ29kZTogMjAwLAogICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KCdIZWxsbyBmcm9tIExhbWJkYSEnKSwKICAgIH07CiAgICByZXR1cm4gcmVzcG9uc2U7Cn07Cg=="
14
}
Copied!

Run Lambda

run a specific lambda
Run Lambda:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"run"
function_name
yes
lambda function name
string
data
yes
the run request code , in byte array
byte array
Example:
1
{
2
"metadata": {
3
"method": "run",
4
"function_name": "testfunction",
5
},
6
"data": "bXkgb2JqZWN0"
7
}
Copied!

Delete Lambda

Delete Lambda:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"delete"
function_name
yes
lambda function name
string
Example:
1
{
2
"metadata": {
3
"method": "delete",
4
"function_name": "testfunction"
5
},
6
"data": null
7
}
Copied!
Last modified 11mo ago