How to connect your EC2 instance to VSCode using SSH for remote development
Setting up your ssh file
Make sure you know where you put .pem key as EC2 is not using password to get into the server.
Locate your ssh folders. Usually it is located in your C:/Users/<yourUserName>/.ssh and put your .pem key in this folder. If you did not have.ssh folder please follow this guide.
Open the config file located inside the ssh folders. if you dont have config file, create one.
1$ touch config
Paste this line into your config file and save.
Host <Your EC2 IP>
HostName <Your EC2 IP>
User <your remote server username>
IdentityFile c:\Users\<yourUserName>\.ssh\yourPemKeyName.pem
After you click a bar will open. search for Connect Current window to host and click that option.
You will see your Ip is in the list and click your ip to connect in the dropdown menu.
After you successfully connect to your remote server, it may take some time for your server to setup.
You can then open any folder or workspace on the remote machine using File > Open… or File > Open Workspace… just as you would locally!
Make sure you check you extension because currently you are running vscode in your remote server. install all required extension to your remote server. You can check the status in your extension page in vscode.