How to do VSCode remote connection to EC2 via EC2 Instance Connect (EIC)?

0

Hey, EIC looks like a pretty nice feature to SSH in private net EC2s https://aws.amazon.com/blogs/compute/secure-connectivity-from-public-to-private-introducing-ec2-instance-connect-endpoint-june-13-2023/

So that triggers the question: how to use EIC via the VSCode Remote Development extension to connect to an EC2?

Olivier
asked 5 months ago341 views
1 Answer
0

Hello.

If you use VSCode's RemoteSSH extension, try setting ssh_config as follows.
"ssh.pem" is the SSH key set to ec2-user.
With this setting, you will be able to connect to EC2 configured with ProxyCommand and manipulate files.

Host instance1
    HostName i-0eyyyyyyyyyyy
    User ec2-user
    IdentityFile .\Desktop\tmp\ssh.pem
    ProxyCommand aws ec2-instance-connect open-tunnel --instance-id i-0eyyyyyyyyyyy
profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions