ccpgames/aws-nginx-ha-manager

Name: aws-nginx-ha-manager

Owner: CCP Games

Description: Manages an nginx HA proxy by querying an ELB

Created: 2016-08-25 14:05:17.0

Updated: 2016-09-06 12:24:47.0

Pushed: 2016-09-07 11:58:38.0

Homepage: null

Size: 4781

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

aws-nginx-ha-manager (0.1.4)

Build Status

This utility is designed to run beside an nginx HA proxy and monitor an AWS ELB and update the list of upstream servers to match the ELB.

The purpose of this utility is to solve some issues with ELBs, such as support for long-polling, proper websocket support and other matters.

The utility queries AWS APIs and ensures the list of ips in the upstream list matches them exactly.

Note: It depends on systemd, i.e. CoreOS, Redhat et al, or newer debian based systems

Example usage

To monitor an ELB named CertVKPil-ServiceL-15ERWL9O3YIZI issue the following command:

s-nginx-ha-manager monitor CertVKPil-ServiceL-15ERWL9O3YIZI --upstream-file /etc/nginx/conf.d/pilot.upstream.conf --upstream-name pilot --port 8000 --interval 5

This will query the AWS API every `5seconds and write an upstream file to ``/etc/nginx/conf.d/pilot.upstream.conf` with upstream namepilot`` calling on port `8000`

You can also type `aws-nginx-ha-manager --help` for a list of options and commands.

Access requirements

The command requires access to the AWS ELB API, specifically the action `elasticloadbalancing:DescribeListeners`.

Example policy below:


"Version": "2012-10-17",
"Statement": [
    {
        "Sid": "Stmt1473172616000",
        "Effect": "Allow",
        "Action": [
            "elasticloadbalancing:DescribeListeners"
        ],
        "Resource": [
            "arn:aws:elasticloadbalancing:eu-west-1:577470089438:loadbalancer/CertVKPil-ServiceL-15ERWL9O3YIZI"
        ]
    }
]


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.