Making an AWS NLB Primary-Aware: Role-Based Health Checks for a Patroni PostgreSQL Cluster
How two small HAProxy health endpoints let a plain Layer 4 AWS Network Load Balancer send writes to the PostgreSQL primary and reads to the replicas in a Patroni cluster, with no floating IP and no single point of failure in the routing layer.

