mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
Floci serves each RDS database through a proxy in the 7001-7099 range, and Endpoint.Port and DBCluster.Port reported that proxy port even when the request set Port=5432. The Terraform AWS provider sets port from those fields, so every aws_db_instance and aws_rds_cluster with a conventional port planned port 7001 -> 5432 on each run. floci.services.rds.advertise-requested-port (FLOCI_SERVICES_RDS_ADVERTISE_REQUESTED_PORT), off by default, makes DBInstance.Endpoint.Port and DBCluster.Port report the requested Port, while the proxy keeps listening in its range. A cluster member without its own Port reports its cluster's. The managed master-user secret and a CloudFormation secret target attachment keep the connectable proxy (or published) port. The requested port is stored, so a restart or a backend retry rebuilds the same advertised endpoint, a stopped database follows the setting if it changed across a restart, and a blue/green switchover moves the requested port with the endpoint it belongs to. Closes #4575 Co-authored-by: Allen Sanborn <allen.sanborn@gmail.com>