How to add your Amazon Web Services CodeCommit Repository to DeployHQ
If you wish to add your AWS CodeCommit repository to DeployHQ, you'll need to add it manually. Let's do this step by step.
First, go to your AWS CodeCommit repository page, and look for the "Clone" button. Once there, make sure to select the SSH option, and copy the clone URL generated for you. Save it in a text editor, as we will need to edit this link shortly.
Once done, check in your DeployHQ repository interface if the SSH key generated starts with ssh-ed25519 or ssh-rsa. As currently, AWS CodeCommit only accepts RSA keys, we need to make sure that the keys used in this step are RSA.
If the key generated in this step is already an RSA key, then good news! You only need to copy this SSH key, and add it to your AWS IAM account, under your IAM user, as described here (from step 3.3 to step 3.6).
On the other hand, if the key generated is not an RSA key, don't worry, the process only adds a couple of extra steps. First, you'll need to generate a new key pair of RSA keys and upload the private key to your DeployHQ account. This step and more details can be found in this handy guide. Keep in mind that, during this "Add your repository manually" step, you can add this private key directly in the same page by clicking the "upload your private key", located below the SSH key box.
Once the private key is added to your DeployHQ account, you need to upload the public counterpart of your freshly generated key to your AWS IAM page, as described here (steps 3.3 to 3.6).
Regardless of the SSH key method you had to take in the previous steps, you should now have your public key added to your AWS IAM page under your user. Now, from here you should see an entry under SSH public keys for AWS CodeCommit
, mentioning an SSH key ID, which should be Active
.
You can copy this SSH key ID and add it to your repository URL, such that it should end up looking like this:
ssh://[SSH_key_ID]@[REPOSITORY_URL].
In my case, the SSH key ID is: APKA4PBYFNJACUZMGK72
So my URL would be: ssh://APKA4PBYFNJACUZMGK72@git-codecommit.eu-north-1.amazonaws.com/v1/repos/testingDeployHQconnection
Once done, you can leave the Hosting Service as Auto detect
, and click on Create Repository.
And you're done! Your AWS CodeCommit repository is now connected to your DeployHQ project, and you can set up your configuration for your servers, automatic deployments, etc.