Before you force a failover, prepare two ways to see it:
rdspg-lab-db to the SNS topic rdspg-lab-alarm-topic that you created in chapter 3, so you receive an email.In the Amazon RDS console:

In Details and Target:
rdspg-lab-failoverrdspg-lab-alarm-topic
In Source:
rdspg-lab-dbfailover
The subscription is created:
rdspg-lab-failover is Active, with the source type Instances.
The SNS topic already has your confirmed email subscription from chapter 3. If you use a new topic, confirm the email that SNS sends you before you test the failover.
Connect to the App server (ssh rdspg-app) and run the following loop. Leave it running in this window:
while true; do
echo "$(date +%T) DNS=$(getent hosts $PGHOST | awk '{print $1}') server=$(PGCONNECT_TIMEOUT=3 psql -d pglab -Atc 'SELECT inet_server_addr()' 2>&1 | head -1)"
sleep 2
done
DNS is the private IP address that the endpoint of rdspg-lab-db resolves to.server is the IP address of the DB instance that answers, returned by inet_server_addr(). Both are the IP address of the current primary.