mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 23:59:27 -05:00
With floci.services.rds.endpoints-in-vpc on, each instance of an Aurora DB cluster gets its own address in its VPC, as a standalone instance does, and serves the cluster's port, which the API reference says "is managed by the cluster". The cluster reports the names the Aurora user guide gives its endpoints, <cluster>.cluster-<identifier>, <cluster>.cluster-ro-<identifier> and <endpoint>.cluster-custom-<identifier>, and Floci's DNS server resolves them to the instances as Aurora points them: the cluster endpoint to the writer, following a failover; the reader endpoint to another instance, or the writer when none is served; a custom endpoint to one of the instances it holds, picked at random, and none once its static members are all deleted. Answers live five seconds, the TTL of Aurora's DNS zones. A Multi-AZ DB cluster, whose instances Floci does not create, and an Aurora Serverless v1 cluster, which has none, keep the proxy endpoint. The names are routed again whenever a cluster's instances, writer or custom endpoints change, under one lock, and are restored at restart. An IAM token generated for any of a cluster's names is good at each of its instances, and the proxies' certificate covers the names. StopDBCluster removes the instances' relays and StartDBCluster serves them again; a failed instance create forgets its name and leaves the names as they were; a cluster restored from a snapshot serves the snapshot's port. Refs #6273