Create RDS Instance
Lab: Creating an Amazon RDS Database Instance
Lab overview
Follow these steps to create an Amazon Relational Database Service (Amazon RDS) database (DB) instance that maintains data used by a web application.
Duration
This lab requires approximately 20 minutes to complete.
Access the AWS Management Console
To start the lab session, choose Start Lab in the upper-right corner of the page.
The lab session starts.
A timer displays in the upper-right corner of the page and shows the time remaining in the session.
Tip: To refresh the session length at any time, choose Start Lab again before the timer reaches 0:00.
Before continuing, wait until the lab environment is ready. The environment is ready when the lab details appear on the right side of the page and the circle icon next to the AWS link in the upper-left corner turns green.
To return to these instructions, choose the Readme link in the upper-right corner.
To connect to the AWS Management Console, choose the AWS link in the upper-left corner, above the terminal window.
A new browser tab opens and connects you to the AWS Management Console.
Tip: If a new browser tab does not open, a banner or icon is usually at the top of your browser with the message that your browser is preventing the site from opening pop-up windows. Choose the banner or icon, and then choose Allow pop-ups.
Note: You are using the console through the lab environment, so you are not incurring any actual costs. However, in the real world, when using a personal or business account to access the console, users incur charges for use of specific AWS services.
Task 1. Set up an RDS DB instance
Choose the Services menu, locate the Database category, and then choose RDS.
Choose Create database.
In the Choose a database creation method section, choose Easy create.
In the Configuration section, configure:
For Engine type, choose Microsoft SQL Server.
For DB instance size, choose Free tier.
Check the box next to Auto generate a password.
Choose Create database.
Your new database displays in the list of databases. The status is Creating.
In the banner at the top of the page, choose View credential details.
Your login credentials display.
Save the credential information to a text editor to user later in this lab.
To close the pop-up window, choose Close.
Task 2. Download and install SQL Server Management Studio
To connect to your RDS DB instance, you will need to download and install SQL Server Management Studio.
In a new browser tab or window, go to https://aka.ms/ssmsfullsetup.
Download the installation package to your computer.
When the download completes, open and run the installation program.
Note: If you are unable to install new software on your local machine, follow the instructions to use the Amazon Elastic Compute Cloud (Amazon EC2) instance that was launched in this lab environment.
Task 3. Make your database publicly accessible
In the Amazon RDS console, choose the name of the SQL Server database that you created.
In the Connectivity & security section, for Security, notice that Public accessibility is currently set to No.To change this setting, choose Modify at the top of the page.
Scroll down to the Connectivity section, and expand Additional configuration.
For Public access, choose Publicly accessible.
Scroll to the bottom of the page, and choose Continue.
In the Scheduling of modifications section, for When to apply modifications, choose Apply immediately.
Choose Modify DB Instance.
After about 30 seconds, the Status for the database changes to Modifying. Before continuing, wait until the status changes to Available.
Tip: You might need to refresh the database information. To refresh, choose the refresh icon.
Task 4. Update your VPC security group
By default, the virtual private cloud (VPC) default security group does not permit inbound SQL Server traffic from external sources. In this task, you will turn on inbound SQL Server connections from your IP address.
Note: If you are using the EC2 instance, you will use the WindowsWorkstation IP address that you saved earlier. In this case, skip the next few steps to get your IP address.
First, get your IP address.
In a new browser tab or window, go to https://whatismyipaddress.com/.
Copy the IPv4 value to a text editor to use later in this lab.
Now, modify the security group to permit inbound SQL Server connections from your computer or the WindowsWorkstation instance.
Return to the browser tab that is open to the AWS console. Ensure that you are on the RDS > Databases page.
Choose the name of the database you created.
In the Connectivity & security section, under VPC security groups, choose the name of the security group.
The security group name looks similar to the following: default (sg-a12345b6)On the Security Groups page, choose the Inbound rules tab.
Choose Edit inbound rules, and choose Add rule.
For Type, choose MSSQL.
For Source, choose Custom, and enter your IP address or the IP address of the WindowsWorkstation instance in the text box.
Add /32 at the end of the IP address. The full text should look similar to the following: 123.12.123.23/32
Choose Save rules.
Task 5. Connect to your DB instance
First, you will need to find the Domain Name System (DNS) endpoint and port number for your DB instance.
Return to the RDS > Databases page.
Choose the name of the database you created.
On the Connectivity & security tab, copy the Endpoint value to a text editor.
The endpoint looks similar to the following: sample-instance.abc2defghije.us-west-2.rds.amazonaws.com
Notice the Port number.
The default port for SQL Server is 1433.
If your port number is different, copy that value to your text editor.
Open the Microsoft SQL Server Management Studio application.
Note: If you are using the EC2 instance, start the Microsoft SQL Server Management Studio application in your remote desktop window.
The Connect to Server dialog box appears.For Server type, choose Database Engine.
For Server name, enter the database endpoint value that you copied.
At the end of the endpoint value, add a comma ( , ) and the port number (the default port number is 1433).
For example, your server name should look similar to the following: database.abc2defghije.us-west-2.rds.amazonaws.com,1433
For Authentication, choose SQL Server Authentication.
For Login, enter the username for your DB instance.
This is also known as the administrator username. The default is admin.
For Password, enter the password that you copied for your DB instance.
This is also known as the administrator user password.Choose Connect.
After a few moments, you are connected to your database.
If the connection does not succeed, repeat Task 4 to update the default security group. When you add the inbound rule, for Source, choose Anywhere instead of My IP. (Note: Only select Anywhere for the purpose of this lab. This selection presents a security risk in the real world.)
Task 6. Explore the structure of the relational database
Great work! You can explore the structure of the relational database by expanding the areas in the Object Explorer pane.
You will see that the SQL Server has built-in system databases such as model, msdb, and tempdb. You can even create a new database if you would like to experiment more.
Lab complete
Congratulations! You have completed the lab.
Log out of the AWS Management Console.
In the upper-right corner of the page, choose your user name. Your user name begins with voclabs/user.
Choose Sign Out.
Choose End Lab at the top of this page, and then select Yes to confirm that you want to end the lab.