Can consul be used to trigger an endpoint URL change and propogate new endpoint to servcies?

Say I am using RDS and my main master goes down and the failover is now master, can consul be used to propagate this change to my microservices?

Is there golang example of how to use consul in this manner somewhere that I can look into?

How are you registering the RDS instances into Consul?

You could add an active tag to the RDS master and then configure your applications to connect to that node by using the hostname active.<service_name>.service.consul.

You would need some external process to monitor RDS and add/remove the active tag on the service registrations as the role (e.g., active or standby) of each RDS instance changes.