Summary
When a swarm's EC2 instance restarts (stop/start, maintenance, or recycling), AWS can assign it a new public IP. The swarm then becomes unreachable at its previous address, and its route53 record (see #516 / #484) points to a stale IP until someone fixes it manually.
Proposal: each swarm reports its current public IP to SuperAdmin once every 5 minutes. SuperAdmin stores the last-known IP per swarm and, if it changed, updates the swarm's route53 record. Swarms stay reachable across IP changes with zero manual intervention.
Proposed steps
- Heartbeat sender in the swarm: a small service similar to the existing
cln / down / btc / sphinx / tome binaries under src/bin/ that every 5 minutes:
- resolves the instance's public IP (EC2 instance metadata service, with a fallback for non-EC2 environments)
- POSTs it to SuperAdmin (
/swarm/heartbeat with swarm id + public IP)
- Heartbeat endpoint in SuperAdmin (
src/bin/super/routes.rs): accepts the heartbeat, stores last_ip + last_heartbeat_at per swarm, and compares the IP against the previously stored one.
- route53 update (
src/bin/super/route53.rs): when the reported IP differs from the stored IP, upsert the A record for the swarm's domain, reusing the route53 helpers already in place for swarm setup.
Storage
Keep last_ip and last_heartbeat_at on the swarm record, persisted the same way other swarm state is stored in SuperAdmin.
Notes
Pros / Cons
Summary
When a swarm's EC2 instance restarts (stop/start, maintenance, or recycling), AWS can assign it a new public IP. The swarm then becomes unreachable at its previous address, and its route53 record (see #516 / #484) points to a stale IP until someone fixes it manually.
Proposal: each swarm reports its current public IP to SuperAdmin once every 5 minutes. SuperAdmin stores the last-known IP per swarm and, if it changed, updates the swarm's route53 record. Swarms stay reachable across IP changes with zero manual intervention.
Proposed steps
cln/down/btc/sphinx/tomebinaries undersrc/bin/that every 5 minutes:/swarm/heartbeatwith swarm id + public IP)src/bin/super/routes.rs): accepts the heartbeat, storeslast_ip+last_heartbeat_atper swarm, and compares the IP against the previously stored one.src/bin/super/route53.rs): when the reported IP differs from the stored IP, upsert the A record for the swarm's domain, reusing the route53 helpers already in place for swarm setup.Storage
Keep
last_ipandlast_heartbeat_aton the swarm record, persisted the same way other swarm state is stored in SuperAdmin.Notes
Pros / Cons