Skip to content

Latest commit

 

History

History
80 lines (59 loc) · 3.74 KB

README.md

File metadata and controls

80 lines (59 loc) · 3.74 KB

kempdnsscaler

AWS Lambda function to manage list of Real Servers for Virtual Services in the LoadBalancer (currently supported KEMP LoadMaster only).

Installation

Please ensure you have the AWS CLI installed and configured with credentials.

To deploy AWS Lambda function please utilize installation script: install.sh or install.bat - it will build the project, create AWS Lambda service execution role and finally will deploy the function.

In case of changes of the Lambda function logic, it is also possible to utilize update scripts to deploy changes: update.sh or update.bat.

Details

Class de.objectiveit.kempdnsscaler.VSManager implements AWS request handler interface and consumes de.objectiveit.kempdnsscaler.model.VSRequest DTO as input, which should look something like this:

{
    "notificationTopicArn": "arn:aws:sns:eu-central-1:123456789012:NotificationTopic", // in case notification is needed
    "loadBalancerURL": "https://some.loadbalancer.de",
    "credentials": {
        "login": "admin",
        "password": "verysecret"
    },
    "vs": {
        "ip": "1.2.3.4",
        "port": 8080,
        "protocol": "tcp"
    },
    "rsIPs": [
        "1.2.3.10",
        "1.2.3.11",
        "rs.realserver.com"
    ],
    "rsPort": 80
}

Please find parameters list and their descriptions in the table below:

Parameter Description Example
notificationTopicArn Amazon SNS topic ARN to use for notifications (details below). Notification will be sent only in case of changes (of VS configuration) and errors "arn:aws:sns:eu-central-1:123456789012:NotificationTopic"
loadBalancerURL LoadBalancer base URL, might be either FQDN or IP based "https://some.loadbalancer.de", "http://12.13.14.15"
credentials LoadBalancer login and password, in case of KEMP LoadMaster it is the REST API basic auth credentials >> { "login": "admin", "password": "verysecret" }
vs Parameters of the Virtual Service to manage: IP, port and protocol { "ip": "1.2.3.4", "port": 8080, "protocol": "tcp" }
rsIPs Array of Real Service FQDNs/IPs to set up for the VS, in case of the fully successful operation (no partial RS failures) - VS will be configured only with these RS IPs - unneeded ones will be removed, required ones will be added. For the FQDN entries nslookup will be utilized to prepare list of IP addresses to add (details below) [ "1.2.3.10", "1.2.3.11", "rs.realserver.com" ]

nslookup

As it is mentioned above for FQDNs nslookup will be utilized, so e.g. for the RSs list below:

    "rsIPs": [ "1.2.3.10", "1.2.3.11", "rs.realserver.com" ]

In case when there are 3 IP addresses behind rs.realserver.com:

$ nslookup rs.realserver.com
Server: some.server.com
Address: 11.22.33.44

Name: rs12345.realserver.de
Addresses: 1.2.4.1
1.2.4.2
1.2.4.3
Aliases: rs.realserver.com

Result list of IP addresses to configure will be: 1.2.3.10, 1.2.3.11, 1.2.4.1, 1.2.4.2, 1.2.4.3

E-mail notifications

As it is mentioned above notificationTopicArn parameter can be used to set up Amazon SNS notifications, e-mail based notifications is preferred since notification message will be big/informative enough.

Usage is straightforward, need only:

  1. To create a topic and to register as much subscriptions as needed, please refer AWS official documentation for details
  2. And to set up created topic's ARN as it is described above