Update NGINX Upstreams with an AWS Lambda Function

Using an AWS Lambda function to update a Route53 DNS record periodically to allow for dynamic updates to NGINX's upstream server list.

Davy Hua

3 minute read

Problem Statement: A subset of our microservices uses the gRPC http/2 protocol. The problem was due to AWS’ lack of direct end-to-end support in all the various types of load balancers available. Since our stack runs in DC/OS, we utilize Marathon-LB to provide load balancing for the service endpoints. Due to this limitation, we have to bypass AWS ELB by using NGINX’s new gRPC support to provide reverse proxy into to our Marathon-LB instances, which leaves wide open an issue where one or more of the upstream servers’s IP could change at any given time by our auto scaling group.