Connecting Amazon RDS To Visual Studio Code

I'm AWS Certified Solution Architect. I do write about the AWS Cloud Operation, Migration, Security and Automations.
Search for a command to run...

I'm AWS Certified Solution Architect. I do write about the AWS Cloud Operation, Migration, Security and Automations.
No comments yet. Be the first to comment.
Introduction: Migrating physical or virtual machines from on-premises to AWS can feel scary but AWS Application Migration Service (MGN) makes it straightforward by continuously replicating servers to AWS and enabling test launches and cutovers with m...

Migrating your on-premises MySQL database to Amazon RDS for MySQL with AWS Database Migration Service (DMS) is a common way to move to a managed, highly available database while keeping zero downtime or minimal. In this blog, I’ll show how you can mi...

Introduction: Monitoring storage utilization is critical to ensure application stability and avoid unexpected outages. In AWS, Amazon EBS does not provide built-in metrics for volume-level disk usage, which makes proactive alerting a challenge. To ad...

Introduction: we need to securely transfer sensitive documents to the cloud without manual intervention. A common requirement is to automatically detect file changes, apply client-side encryption, and upload only the modified files on a scheduled bas...

Introduction: Data migration and disaster recovery are key considerations for building resilient cloud architectures. A common requirement is to migrate data from an local machine to a primary Amazon S3 bucket, while ensuring that the same objects ar...

Amazon RDS (Relational Database Service) is a managed database service provided by Amazon Web Services (AWS). It allows you to set up, operate, and scale a relational database in the cloud with ease. RDS supports several popular database engines, including Amazon Aurora, MySQL, PostgreSQL, Oracle, and SQL Server.
Step 1: Go to the AWS management console, search for RDS and click on it.

Step 2: Click on Create database


Step 3: From the Templates, select the Free tier

Step 4: Select MySQL from the Engine options

Step 5: Under the Settings
Give a name to the database instance identifier
enter the Master username and Password (Note it down, you need to remember this )

Step 6: From the instance configuration, select Burstable classes

Step 7: Under Storage select general purpose SSD(gp2)

Step 8: From the Connectivity,
select Don't connect to an EC2 compute resource.
Select Default VPC, from the Virtual private cloud(VPC)

In the Public access, select yes
Under the VPC security group(firewall), you can choose existing or create new. For now, we create a new one and named it as “sec-group” and also selected “us-east-1a" Availability Zone.

Step 9: Under Database authentication


Step 10: In the Additional configuration
Give the initial database name. For now say “worlddb” (NOTE the Database Name)
Unselect under Backup and Encryption

Unselect Enable auto minor version upgrade, under Maintenance
Select no preference under Maintenance window

Step 11: Click on Create database

Step 12: You need to have pre-installed SQLTools and SQL Server(mssql)

Step 13: From the connections click on Add New Connections icon.

Step 14: Select MySQL

Step 15: From the database under Connectivity and security copy the endpoint address.

Step 16: In the VS code under Connection Settings
Give a name to the connection let’s say: "justconnecting"
in the Server Address: Paste the endpoint address.
Enter the database name, that you have created in the AWS RDS as “initial database” and noted down.
Enter the database Master username,







Now click on the New SQL File on the right side on connetions
Enter the below query
use worlddb;
CREATE TABLE student(
Id int,
Name VARCHAR(20)
);
INSERT INTO student(Id, Name)
VALUES(1, 'Abi'),
(2, 'Gaurav');
SELECT * FROM student;
Run the query using pressing CTRL+ E+E

You have successfully connected the AWS RDS to your Visual Studio Code.