Course Content
Introduction to Cloud Computing
Introduction to Cloud Computing
Connecting to the RDS Instance
Security Group Configuration
As you might have noticed, we're using the same security groups that we set up when creating and running the EC2 instance. There, we have permissions to connect using SSH keys and HTTP ports from any IP address.
We also need to add one option for connecting to the database. As you're probably aware, MySQL databases usually run on port 3306
, so we need to allow connections from this port in the security groups. We can allow connections from any IP by setting 0.0.0.0/0
, or we can restrict connections to just our own IP for added security by specifying our IP.
Since we'll be allowing connections from any IP, let's go to the security group settings we selected when creating the database instance and add a new permission.
As you can see, AWS provides us with an option for inbound rules for MySQL or Aurora. We can see that the connection will be made using the TCP protocol and have a Port Range of 3306
, which is the default for MySQL DBMS.
I also allowed connections from any IP by specifying 0.0.0.0/0
. However, you can select the "My IP" option here to allow the connection only from your IP address.
Connecting to MySQL Workbench
As I mentioned earlier, we'll be managing our cloud database from our local computer.
To do this, open MySQL Workbench and click on the "connect" button:
You'll see the following window. Here, we need to enter the data we specified when creating the database instance.
You can find the database endpoint (hostname) in AWS here:
After entering all the data, click on "Test Connection" to check the accuracy of the entered data and the connection. Your connection window should look something like this:
Now, you can click "OK" in the bottom right corner, and the new connection will appear in your MySQL Workbench.
As you can see, it has shown up for me too:
You can also go to your list of database instances in AWS and see that new connections with MySQL have appeared for the instance you connected to:
We've successfully connected to the database instance through the local workbench. In the next chapter, we'll explore the basic commands we can use with such an instance and what our database will look like.
Thanks for your feedback!