If you already have a key pair, you can skip to the next step.
First, you need to enter the EC2 Console. On the left navigator bar, choose Key Pairs. On the Key Pairs interface, choose Create Key Pair.
On Create Key Pair:
Save your private key in your local computer and use it later for the lab stack creation.
Ensure that only you can access the .pem file.
chmod 400 <đường dẫn tới file pem>
Dowload the template here.
Enter the CloudFormation console.
Enter **Stack Name**s.
At SshKeyName, enter the newly created Key Pair (from the previous step).
Click Next through all steps and wait for the stack to complete.
On the CloudFormation Stack UI, get to Output. Find the key IdeInstancePublicIP, the value is the address of your VSCode server instance.
Add the following lines C:\Users\<username>\.ssh\config
(on Windows) hoặc ~/.ssh/config
(on Linux):
Host remote-connection
HostName <EC2 public ip>
User ec2-user
IdentityFile "<path-to-pem>"
After installing you’ll see the icon on the lower left corner of the screen
Click the icon to open the Connection command pallete. Choose “Connect to Host…”
Choose your config file
After configuring, click the icon to open the pallette and choose “remote-connection”
Next, choose Platform details “Linux”, then “Continue”
Choose “File > Open” to open your environment folder
Choose the folder /home/< username >/environment