C2W1 Lab: Where does VS Code fit in the architecture?

While working on the lab for C2W1, I realized I did not understand how VS Code worked - how were we able to connect to certain resources in AWS through VS Code? why was it that we had to connect to the EC2 instance to create and add data to the Postgres SQL database? Could we not have done it through VS Code?

I understand this must be too elementary a question but any help with this would be greatly appreciated! Thanks.

@vchillara If you’re talking about the assignment of C2W1, then in that lab we wanted you to compare between two scenarios:

First scenario: two resources (EC2 + database) connecting from two different VPCs
Second scenario: two resources (EC2 + database) connecting from the same VPC

We used EC2 to represent the environment from which you’d need to connect to the database because it’s easy in this way to demonstrate the two scenarios.

The VSCode is hosted in an external environment hosted by coursera servers and we don’t have control over this server for us to demonstrate the two scenarios. You could definitely use the VScode to connect to the database but the database need to be public or if it’s private we’d need to use extra AWS resources like NAT gateway to connect to the database. And that would have made the exercise more complicated.

So this is why we opted to use EC2 for the ease of demonstrating the objective of the assignment.