Does anyone know where to find the values needed for the parameters required for an ssh connection involving a bastion host and an AWS RDS instance?
I have listed what I have been able to find so far below:
SSH Hostname
- Endpoint given for RDS instance in the AWS console
SSH Username
- I'm seeing in tutorials all over the place it's ec2-user
, should I also use this?
SSH password
- do I need this, since I already have a .pem file for the key pair?
`
MySQL Hostname
- I'm not sure what to put for this. MYSQL Server Port
- 3306Username
- rootPassword
- not sure which password this is referring toThere are two ways ,
If you are trying to access the RDS instance from local computer, you need to make sure that public access is enabled from db settings. By this way you can connect using db endpoint and username password.
Another way is through ssh tunneling, in which database is not needed to be accessible publicly but needs to be accessible from instance inside vpc.. You need to ssh to the machine using instance's credentials like username password or key file. Then, once connected to ec2 instance, you can use db endpoint credentials to connect to RDS instance using SQL connection commands. You will need to configure security groups to allow the connections from RDS and ec2 to do this.
Details of parameters :
SSH Hostname - Ec2 instance external IP address or DNS name. Can be found on ec2 console description tab.
SSH Username - ec2 instance username. Can be found in ec2 console -> ec2 details.
SSH password - ec2 instance password. - not needed if using key file.
SSH Key File` - pem file created or used when ec2 instance was created.
MySQL Hostname - RDS endpoint - you can get from RDS console.
MYSQL Server Port - usually 3306, but if modified during RDS creation, check in RDS console.
Username - database username that was set while creating RDS.
Password - Database password set while creating instance.