How to access AWS Cloud9 IDE from VSCode?

 
 

There are great benefits from using Cloud9, especially with Terraform, it’s super-fast since the connection to AWS API happens internally, I was facing terraform apply took up to 15 minutes on my machine, now when running the same commands on cloud9 it’s only 15 seconds!

The Cloud9 UI is nice, but you can still VScode with all of your extensions with cloud 9, using remote ssh extension.

Remote Development using SSH

Architecture SSH
Architecture SSH

How to connect to Cloud9 EC2 instance from local VSCode

  1. Create Cloud9 EC2 instance
  2. Open port 22 on cloud9 SG from your IP
  3. Install ssh remote ext https://code.visualstudio.com/docs/remote/ssh
  4. Setup SSH key locally
   ssh-keygen -t ed25519
   cat ~/.ssh/id_ed25519.pub
   [ copy your key]

   nano ~/.ssh/config # add the following
   Host hl-dev-cloud9
    HostName ec2-XX-XXX-XX-XXX.eu-central-1.compute.amazonaws.com
    User ec2-user
    IdentityFile /Users/mohammed/.ssh/id_ed25519_cloud9

  1. Add Pub Key to Cloud9 EC2 instance.

  1. Login into the EC2 and add your SSH Pub Key
cat >> ~/.ssh/authorized_keys
[ paste your key here]

  1. Go to VSCode UI choose remote ssh machines and choose your cloud9 instance

vscode c9

Cloud9 Instance: Setup AWS CodeCommit Access, Install Terraform and Terragrunt

  1. Setup your ENV workflow for AWS Access [~/.aws/config]:
  2. Git Access https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-unixes.html#setting-up-https-unixes-credential-helper
  3. Install Terraform, Terragrunt

Troubleshooting

How to solve "Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)?

When you see this notification, it indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files. The current limit can be viewed by running:

cat /proc/sys/fs/inotify/max_user_watches

The limit can be increased to its maximum by editing /etc/sysctl.conf and adding this line to the end of the file:

fs.inotify.max_user_watches=524288

The new value can then be loaded in by running sudo sysctl -p.



      

Share your ACM Private CA cross-account

How to automate AWS RAM to share your ACM Private CA cross-account

 

Sep 3rd 2020

 

David Krohn

App Mesh and ECS with shared Meshes

Step by Step Tutorial on how to use App Mesh on ECS with cross account ressource sharing (shared meshes)

 

Jul 25th 2020

 

Yassine Berrada Touati

Terraform CI/CD Best Practices

Running Terraform in Automation

 

May 15th 2020

 

Mohammed Yahya