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.
How do I connect to an RDS instance?
- Open the Amazon EC2 console, and choose Launch instance.
- Select an Amazon Machine Image (AMI).
- Choose an instance type, and then choose Next: Configure Instance Details.
- For Network, choose the VPC that the RDS DB instance uses.
- For Subnet, select the subnet that has an internet gateway in its routing table.
How do I access my RDS instance from Putty?
- Switch to the inbound tab and choose MYSQL from the dropdown.
- Erase the 0.0. 0.0/0 in the source field then click the input field. It will present you with a list of existing security groups. Choose the one that your EC2 instance belongs to.
- Click the apply rule changes button.