SSH to CodeCommit

Although you can access CodeCommit from the AWS Console, the most efficient way to access it, is via SSH. Assuming you already have an IAM user, as well as Git installed on your local machine, it’s time to setup a SSH connection to CodeCommit by performing the following commands.

  1. Generate a RSA key pair
  2. Copy the public key to the clipboard.
  3. Upload the SSH public key to the AWS IAM Console.
  4. You’ll receive a SSH Key ID.
  5. Create a config file
  6. chmod 600 config
  7. Test connection
  8. Clone repo

To get more details regarding SSH access to CodeCommit, visit the AWS docs.

Create a Repository in CodeCommit

CodeCommit is a version control system hosted in AWS that you can use privately to store and manage your source code, documents or binary files. You can get free (as in beer) unlimited repositories, if you have less than 5 users, and if your storage is less than 50 GB-month, and you have less than 10,000 git requests per month. If you have more than 5 users, it’s $1 a month per user. Still not bad. Here’s CodeCommit pricing.

Create a repository in CodeCommit via the Console or the CLI.

aws codecommit create-repository --repository-name myrepo --repository-description "My repository"

Create in another region.

aws codecommit create-repository --region us-west-2 --repository-name myrepo --repository-description "My repository"

Enjoy.