Extend fleet-terraform modules to support multiple read replicas in RDS
Currently deployments with over 50k hosts hit the read replica significantly harder than the writer. Because of this, scaling both to accommodate the load on a reader results in a heavily under-utilized writer.
Aurora best practices are to have all nodes be the same size so that any can be promoted to a writer at any time, so using differently-sized nodes is not an option.
Therefore, we should extend the fleet-terraform modules (specifically the byo-vpc module) to support 3 or more read replicas optionally with a parameter.
Testing below changes.
Changes https://github.com/fleetdm/confidential/blob/rds-dynamic-replicas/infrastructure/cloud/template/main.tf#L72 https://github.com/fleetdm/confidential/blob/rds-dynamic-replicas/infrastructure/cloud/template/main.tf#L95 https://github.com/fleetdm/fleet-terraform/blob/rds-dynamic-replicas/variables.tf#L82 https://github.com/fleetdm/fleet-terraform/blob/rds-dynamic-replicas/byo-vpc/main.tf#L54
Tested with brand new fleet instance. Fleet is accessible and works with 1 replica.
Also tested scaling replicas up and down.
PR: https://github.com/fleetdm/confidential/pull/10257 PR: https://github.com/fleetdm/fleet-terraform/pull/26
Scaling hosts, a dance, More read replicas advance, Smooth flow, like a trance.