Allow an AWS EC2 Instance Access to an RDS Database

Sam Julien
InstructorSam Julien
Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated 3 years ago

By default, AWS service instances are created in isolation and can't access other services without your explicit permission.

We need to give our Elastic Compute Cloud (EC2) instance access to the Relational database service (RDS) we just created. To do so, we will edit the inbound rules of our database to include the security group that we set for EC2. This will allow access for every item in that security group but currently we only have our EC2 instance.

Instructor: [0:00] We've got our database set up. Now we just need to make sure that our EC2 instance, where we're going to be running node, is able to talk to our database.

[0:09] To do that, we're going to click into our database here. We're going to scroll down here to where this security section is. You can see I'm in this connectivity and security area. We're going to click on the security group here. Once that loads, we can scroll down. Let's pull this up to make it easier to see and scroll down a little bit.

[0:31] We want this inbound rules section. Click on that. We want to edit our inbound rules. You can see here there's already one for MySQL for my IP address. We want to edit inbound rules, because what we want to do is add in the security group for our EC2 instance.

[0:49] You can see here I've got this MySQL for port 3306. That's what we want. We also want the security group that we created for our Ghost server. If I just start typing in Ghost, you can see here I've got this Ghost security groups. I can click that and go ahead and click save rules.

[1:10] Now that's going to allow...You can see here it's listed in our inbound rules. It's going to allow anything in that Ghost security group to access our database through port 3306. The only thing right now that's in that Ghost security group is our EC2 instance.

[1:26] That's basically it. That's what we need to do to open up that port of communication between our EC2 server and our RDS database.

egghead
egghead
~ 10 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today