Troubleshooting Connecting Locally to a RDS in AWS

 · 3 min read
 · Aaron Kyle
Last updated: August 22, 2022
Table of Contents

Get My Content Delivered To Your Inbox

    No Spam, Pinky Promise.

    Starlink

    For the most part, Starlink has been absolutely amazing for users in rural areas and in locations where internet service is limited. I wouldn't consider my location rural by a long shot, but for what is available, the internet speeds are abysmal. Think 25 mb type of speed. Think streaming is okay, but heavy streaming on multiple devices for longer than 24 hours can present a few hiccups.

    Aware of these issues, Starlink enters the ISP(Internet Service Provider) space...

    I sign up, get waitlisted for a over a year, and finally get the greenlight in March of this year. For the most part, it's been great.

    One glaring issue though: Starlink doesn't offer Static IP's currently.

    Starlink FAQ's

    The Problem


    What problem does this create for a Software Engineer using AWS? I've seen this issue occur twice, but in different environments.

    Professional


    1. If you're a remote worker like me and your employer uses cloud architecture(servers on GCP, Azure, or AWS) over on-site systems, your specific home IP address is added to all necessary security groups. This ensures that everyone in the world can't access the backend of their product. If it was open to everyone, they would experience financial and technical havoc in addition to data breaching. Essentially, if your IP address just so happens to change, you will spend half of a sprint trying to find the issue with the devops guy, or by yourself....all to realize that it was something as simple as this. Don't be like me, be better than me.

    Personal


    1. Working on a personal project that also utilizes cloud technologies? You'll experience the same issues as in 1.

    Professional or personal project, whenever this occurs, the original IP address that was added to the inbound rule is no longer valid. Overall, this is just a headache to deal with. :disappointed:

    To give yourself access to the cloud database/server again, you will have to add an inbound rule to the security group attached to your database/EC2 Instance with your IP address added to it.

    EC2 Security Group Inbound Addition

    How Often Does This Occur?


    1. Has your electricity ever flickered or disconnected due to the weather for 15 Secs or more? If so, from a technical side, Starlink assigns a new IP address.
    2. Ever accidentally/purposely unplugged your router? Starlink assigns a new IP address.
    3. Whenever Starlink makes a substantial update/fix to their product. Starlink assigns a new IP address.

    Life happens, and things like 1, 2 and 3 happen a lot in my life. Expect a new IP address in either of these situations if using Starlink.

    The Solution


    Well, we obviously can't tell Starlink what to do, so the only option is to be aware of this product limitation beforehand. Anytime you are having issues connecting to your application, look at your IP Address as one of your first debugging checks. Once you have your IP Address, head over to AWS. Specifically, we'll be looking at RDS and EC2.

    RDS: Get Key Details


    • Find the security group associated with your database
      • Amazon RDS
      • Databases
      • Select your Database
      • Modify
      • Connectivity
      • Look at the security groups
      • Take the last 5 chars of the group that isn't 'DEFAULT'

    RDS Connectivity Component

    EC2: Edit The Inbound Rules


    • Find 'Security Groups' under Network and Security on the sidebar
    • In the Security Group Name column, look for the last 5 chars that you were supposed to remember. That is the SG of the RDS
    • Select It
    • Edit Inbound Rules
    • Add A New Rule
    • Type: Database Type
    • Source: Custom
    • IP: My IP
    • Save Rules

    Edit Inbound Rules

    At this point, you should be able to connect locally. To test it, open PGAdmin, connect to the right db, and you should be in. SUCCESS!

    As a small side tip, if you ever need to check your IP address simply Google "what is my ip address". Choose any of the sites on the first page and you should be okay.

    If you've run into this issue before, I hope this helps, and for all developers considering moving over to Starlink, just be informed. This has been a headache for a while for me, so what I did was keep my old internet service active. It isn't as great, but it gives static IP addresses.

    If there is another easier fix than updating your IP Address, feel free to shoot me a message! I'd be glad to try it out.

    Get My Content Delivered To Your Inbox

      No Spam, Pinky Promise.