server_id に session_id='MASTER_SESSION_ID' があればプライマリのインスタンス。
postgres=> select server_id,session_id,highest_lsn_rcvd,cur_replay_latency_in_usec,now(),last_update_timestamp from aurora_replica_status();
server_id | session_id | highest_lsn_rcvd | cur_replay_latency_in_usec | now | last_update_timestamp
-------------------+-------------------+------------------+----------------------------+-------------------------------+------------------------
aurorapostgresv11 | MASTER_SESSION_ID | | | 2020-04-24 13:44:30.808061+00 | 2020-04-24 13:44:29+00
(1 row)
> ホスト文字列を取得するそのほかのオプション
アプリケーションは、DB クラスターのすべての DB インスタンスに接続でき、
aurora_replica_status関数を照会して、クラスターのライターを特定したり、クラスターのその他のリーダーノードを見つけたりできます。