Modify Application

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

1.1 Navigate to EC2 in the console.

1.2 Click on the Instances (running) tile.

1.3 Enable the checkbox next to the UniShopAppV1EC2 instance, then click the Connect button.

1.4 Navigate to the Session Manager tab and 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 We need to restart the EC2 Instance before the new configuration will take effect. Return to the browser tab where you launched Session Manager. Click on the Instance Id link.

1.11 Under the Instance state dropdown, click the Reboot instance menu item.

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