Connecting to an RDS running in the private subnet of AWS VPC to your DevBox.
Follow the Connecting to AWS guide.
Go to RDS > DB Instances > DB Name.
Select Connectivity and Security.
Copy Endpoint.
Go to DevBox.
Connecting to the Database.
Run the following commands as per the RDS Database Engine:
To install the mysql client cli:
To access the database:
To install the psql client cli:
To access the database:
Follow the Connecting to AWS guide.
Go to RDS > DB Instances.
Select Standard Create.
Use one of the DB Engine in the Configuration.
Choose the Available Versions of the Database.
Choose the Templates based on your use-case. It could be Production or Dev/Test.
Scroll Down to the Settings and specify your Database Name.
Choose Cluster Storage Configuration and DB Instance Class.
Go to Connectivity > VPC.
Choose your VPC , DB Subnet Group and Security Group. Make sure the specified Security Group allows inbound db connections.
Click on Create Database.
You will see two endpoints. Copy Writer Type Endpoint.
Go to the Secrets Manager.
Click on Retrieve Secret Value. This secret is storing your Database Username and Password.
Go to DevBox.
Connecting to the Database:
psql -h <RDS Endpoint> --username <Username> -d <Database Name> --password