Modify Application

To connect the application to the newly promoted Aurora Database in the us-west-1 region, we need to modify the Passive-Secondary web application’s configuration.

Connecting the Application

1.1 Click EC2 to navigate to the dashboard in the N. California (us-west-1) region.

1.2 Click the Instances (running) link.

1.3 Select UniShopAppV1EC2HotStandby, then click the Connect button.

1.4 Click the Session Manager link, then click the Connect button.

1.5 After a brief moment, a terminal prompt will display.

1.6 Change the current directory to the ec2-user’s home folder.

sudo su ec2-user
cd /home/ec2-user/

1.7 Open the file for editing with either nano or vi.

sudo nano

Tip: You can use the vi (Debian ManPage ) or nano command (Debian ManPage ) to edit the document.

1.8 Delete the previous file contents. Then copy and paste this script into the script.

java -jar /home/ec2-user/UniShopAppV1-0.0.1-SNAPSHOT.jar &> /home/ec2-user/app.log &

1.9 Save the modifications (CTRL+O) and close the editor (CTRL+X).

1.10 Reboot the EC2 instance so our changes take effect.

sudo reboot

Congratulations! Your Application has been updated to use the Aurora Promoted Database!