Creating an Amazon RDS Database
Simulation
Simulation overview
Traditionally, creating a database can be a complex process that requires either a
database administrator or a system administrator. In the cloud, you can reduce the
number of steps in the process by using Amazon Relational Database Service
(Amazon RDS). In this simulation, you will learn how to use Amazon RDS to
provision a MySQL database and perform a few basic administrative actions.
When you start the simulation, an Amazon Elastic Compute Cloud (Amazon EC2)
instance with a running web application is provisioned in the simulated Amazon
Web Services (AWS) environment.
Objectives
After completing this simulation, you will be able to do the following:
• Launch a MySQL database using Amazon RDS.
• Configure a web application to connect to the Amazon Relational Database
Service (Amazon RDS) for MySQL database instance.
• Perform operations (stop, start, and reboot) on the database instance.
• Perform basic database monitoring.
At the end of this simulation, your architecture will appear as follows:
Prerequisites
This simulation requires that you first complete the Getting Started with
Databases course.
AWS service restrictions
In this simulation environment, access to AWS services and service actions might
be restricted to only what you need to complete the simulation instructions. You
might encounter errors if you attempt to access other services or perform actions
beyond those provided in this simulation.
Task 1: Create an Amazon RDS database
In this task, you create a MySQL database in a virtual private cloud (VPC). MySQL is
a common open source relational database management system (RDBMS), so
there are no software licensing fees.
1. At the top of the AWS Management Console, enter RDS in the search bar.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
2. In the search results, choose RDS.
3. Choose Create Database.
For this simulation, for Choose a database creation method, keep the default,
Standard create, to display the full set of features available.
Engine options
4. Under Engine options, for Engine type, choose MySQL.
5. To scroll down, choose the scroll bar.
You can now configure the database, including the software version, instance
class, storage, and login settings.
6. Choose the Engine Version menu, and then select MySQL 8.0.32.
7. In the Templates section, choose Dev/Test.
8. To scroll down, choose the scroll bar.
The Multi-AZ deployment option automatically creates a replica of the database in a
second Availability Zone for high availability. You will not need a Multi-AZ
deployment for this exercise.
9. In the Availability and durability section, choose Single DB instance.
10. To scroll down, choose the scroll bar.
Settings
11. In the Settings section, for DB instance identifier, enter inventory-db.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
12. Under Credentials Settings, for Master username, keep the default value,
admin.
13. Under Credentials management, choose Self managed.
14. To scroll down to the password fields, choose the scroll bar.
15. For Master password, enter sim-password! in lowercase letters.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
16. For Confirm master password, enter sim-password! in lowercase letters.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
17. To scroll down, choose the scroll bar.
Instance configuration
18. In the Instance configuration section, choose Burstable classes (includes t
classes).
19. The instance type automatically changes to db.t3.micro. Keep this value.
20. To scroll down, choose the scroll bar.
Storage
21. In the Storage section, choose the Storage type menu
22. Select General Purpose SSD (gp2).
23. For Allocated storage, enter 20.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
24. Choose Storage autoscaling to expand the section.
25. Clear the Enable storage autoscaling checkbox.
26. To scroll down, choose the scroll bar.
Connectivity
27. In the Connectivity section, for Compute resource, keep default value, Don’t
connect to an EC2 compute resource. You will establish this manually at a
later stage. Also, for Network type, keep the default value, IPv4.
28. Choose the Virtual private cloud (VPC) menu, and then select the option that
starts with Lab VPC.
29. For the DB subnet group, keep the default value, rds-lab-db-subnet-group.
30. To scroll down, choose the scroll bar.
31. For Public access, keep the default value, No.
32. For VPC security group (firewall), keep the default value, Choose existing.
33. For Existing VPC security groups, choose the X next to default to remove this
security group.
34. Choose the Existing VPC security groups menu, and then select DB-SG.
Choose any place outside the menu to close it.
35. For Availability Zone, keep the default value, No preference.
36. To scroll down, choose the scroll bar.
Database authentication
37. For Database authentication, keep default value, Password authentication.
Monitoring
38. In the Monitoring section, clear the Enable Enhanced Monitoring checkbox.
You will still have basic monitoring metrics available to review, which you will
explore in Task 3 of this simulation.
Additional configuration
39. Choose Additional configuration to expand the section.
40. Under Database options, for Initial database name, enter inventory.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
This is the logical name of the database that the application will use.
41. To scroll down, choose the scroll bar.
42. For Encryption, choose the Enable encryption checkbox to clear it.
43. To scroll down, choose the scroll bar.
Create the database
44. At the bottom of the page, choose Create database.
45. In the Suggested add-ons for inventory-db pop-up box, choose Close.
The following message appears at the top of the page: “Creating database
inventory-db“.
Before you continue to the next task, the database instance Status must be
Available. This process can take several minutes in a live environment.
46. Choose the refresh icon.
Notice that the database has been created, but the Status is Backing-up.
47. Choose the refresh icon again.
Notice that the database Status is now Available, and you can continue to the next
task to connect to it.
Task 2: Configure a web application
communication with the database instance
This simulation automatically deployed an Amazon Elastic Compute Cloud
(Amazon EC2) instance with a running web application. You must use the IP
address of the instance to connect to the application.
In this task, you will use the application to configure connection settings, which
will be stored in AWS Secrets Manager for future use.
Open the web application
48. Choose the recently visited services icon next to the search bar. It is the icon
with nine white squares in three rows of three.
49. Choose EC2.
50. In the left navigation pane, choose Instances.
Notice that there is a running instance named App Server.
51. Select the App Server instance.
52. In the Details tab, choose the copy icon under Public IPv4 address.
53. To open a new tab, choose the plus sign (+) on your browser.
54. In the browser tab, choose the URL field, and then press Ctrl+V on your
keyboard to paste the IP address into the address bar.
o Note: If you are a Mac user, you will also press Ctrl+V on your keyboard.
In this simulation, you will use your keyboard as a Windows keyboard.
55. To load the page, press Enter on your keyboard.
The web application opens. It does not display much information because the
application is not yet connected to the database.
56. Choose Settings.
You can now configure the application to use the Amazon RDS database instance
you created earlier. First, you need to retrieve the database endpoint so the
application knows how to connect to a database.
Connect the web application to the database
57. Choose the Instances browser tab, but do not close the Inventory System tab.
You will return to it soon.
58. Choose the recently visited services icon next to the search bar.
59. Choose RDS.
60. In the left navigation pane, choose Databases.
61. Under DB identifier, choose the link for inventory-db.
62. In the Connectivity & security section, find the endpoint. It should be similar
to this example: inventory-db.c7bo7sqp7mwn.us-east-
1.rds.amazonaws.com. Then, choose the copy icon under Endpoint.
63. Choose the Inventory System browser tab.
64. Choose the Endpoint field, and then press Ctrl+V on your keyboard to paste in
the database endpoint you just copied.
o Note: If you are a Mac user, you will also press Ctrl+V on your keyboard.
In this simulation, you will use your keyboard as a Windows keyboard.
65. For Database, enter inventory.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
66. For Username, enter admin.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
67. For Password, enter sim-password! in lowercase letters.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
68. Choose Save.
The application will save this information to Secrets Manager. It will connect to
the database, load some initial data, and display information.
You can now use the web application to add, edit, and delete inventory
information.
The inventory information is stored in the Amazon RDS for MySQL database you
created earlier in the simulation. A failure in the application server will not lead to
a loss of data, and multiple application servers can access the same data.
Modifying the database entries
69. To insert new records into the table, choose +Add Inventory.
70. For Store, enter Atlanta.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
71. For Item, enter Amazon Alexa.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
72. For Quantity, enter 7.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
73. Choose Submit.
You can also edit existing entries.
74. Choose the edit icon next to Puerto Rico in the top row of the table.
75. For Quantity, clear 12, and then enter 5.
o Note: To record your entry, press Enter on your keyboard or choose any
place outside the entry field.
76. Choose Submit.
77. Choose the X on the Inventory System browser tab to close it.
You successfully launched the application and connected it to the database.
Task 3: Monitor the database instance
Monitoring is an important part of maintaining the reliability, availability, and
performance of any database. Amazon RDS provides many useful metrics to
monitor the health of your database instance. In this task, you will explore some of
the metrics for the database instance you created.
78. On the inventory-db page, choose the Monitoring tab.
79. To scroll down, choose the scroll bar.
80. Observe the Amazon CloudWatch metrics indicating the respective database
instance parameters.
81. Continue to scroll down until you have reviewed all available metrics.
Task 4: Perform operations on the database
In this task, you learn about a few of the administrative tasks that can be
performed on the database in Amazon RDS.
82. In the left navigation pane, choose Databases.
83. Choose the inventory-db database.
84. Choose the Actions menu.
The Actions menu displays various operations, such as Stop temporarily, Reboot,
and so on.
85. To stop the instance temporarily, choose Stop temporarily. The database will
automatically restart after 7 days.
86. In the Stop DB instance temporarily pop-up box, select the checkbox under
Acknowledgement.
87. Choose Stop temporarily.
Note: Stopping the instance also stops the billing charges associated with running
the instance. Databases will continue to occupy storage space and incur billing
charges.
Simulation complete
Congratulations! You have completed the simulation.
In this simulation, you configured and launched an Amazon RDS for MySQL
database instance. You connected an existing web application to the database.
Then, you interacted with the database instance by performing basic tasks, such as
adding and updating records. You reviewed the various metrics available to
monitor the database and gain insights into the health of the database. Finally,
you performed basic database administrative operations by temporarily stopping
the database.
Your feedback is welcome and appreciated.
To provide suggestions or corrections, see Contact AWS Training and Certification.
©2024 Amazon Web Services, Inc. or its affiliates. All rights reserved.