The devcontainer configuration files in this repository install an AWS .pem key from the Learner Lab (via a repository secret) into GitHub Codespaces. This will allow students to ssh to their AWS resources from the Codespace terminal. There are two ways you can use the contents of this repo.
- Create a repo by forking this one OR Include the contents of the devcontainer directory in your repo / template repo.
- Add your .pem file as a GitHub secret called "SSH_KEY" using the following steps in YOUR new repository:
- Go to Settings (top right corner)
- Click on Secrets and variables
- Click on Codespaces
- Click the Green button labelled New repository secret
- Add the secret:
- Launch / Rebuild the Codespaces container.
- SSH to your AWS instance without specifying the location of the key. ie: ssh ubuntu@ip or FQDN.
- Create a repo called dotfiles (if you do not already have one). Your dotfiles repo can be private, and it will still work.
- Follow the steps outlined above (in option A) to add your .pem file as a secret to your dotfiles repo. Keep the same naming conventions.
- Copy install.sh into your dotfiles repo.
- Follow the documentation here to enable your dotfiles repo. https://docs.github.com/en/codespaces/setting-your-user-preferences/personalizing-github-codespaces-for-your-account#dotfiles
- You may need to rebuild the container for any existing Codespaces you own.
- Note: Keys added via your dotfiles repo will be installed over top of per-repo keys with this configuration. I'm sure there's a way to change it up.
This works with GitHub Classroom. The only drawback is you need to give students admin privileges on their assignment repo.
