Skip to content

AWS RDS via SSH Tunnel fails with "Error: dial tcp: lookup mydb.hash.region.rds.amazonaws.com: no such host" #252

@drakythe

Description

@drakythe

Describe the bug
Using a .dblab.yml configuration file I am trying to connect to a remote RDS database that can only be accessed from an EC2 instance that I have an SSH user on. I know this connection can be made to work as I am able to access the RDS instance using Sequel Ace. The error also returns immediately. The immediacy of the error makes it feel like the system isn't even trying the SSH before trying to hit the host and as a result it fails because the host endpoint isn't publicly accessible.

If it matters, I can only access the SSH host machine via a VPN I am connected to.

To Reproduce
Steps to reproduce the behavior:
Step 0: Have an RDS MariaDB/MySQL instance that is only accessible from EC2 instance.

  1. Create .dblab.yml configuration file (See below for file contents)
  2. use dblab --config --cfg-name "myConfig"
  3. get error immediately

Expected behavior
I expected dblab to connect to the database via an SSH Tunnel.

OS (please complete the following information):

  • MacOS 14.6.1
  • Terminal: Warp

Config File
Endpoints/keys/passwords censored. I am not using placeholder values in the actual config file.

database:
  - name: "myConfig"
    host: "mydb.hash.region.rds.amazonaws.com"
    port: 3306
    db: "myDB"
    password: "myPassword"
    user: "dbUser"
    driver: "mysql"
    ssh-host: "ec2.example.com"
    ssh-port: 22
    ssh-user: "sshUser"
    ssh-key: "/Users/myUser/.ssh/id_rsa" #This key is passwordless.
limit: 50

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions