Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
drakythe opened this issue Feb 12, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@drakythe
Copy link

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
@drakythe drakythe added the kind/bug Something isn't working label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant