In this article we will show you how to integrate Buddy with AWS CodeCommit, the Amazon's Git-based version control solution.

Step 1: Synchronizing repository

  1. At the moment, CodeCommit is not availabe from the source provider list. To add it, start with creating a new project and selecting the private Git server:

Source provider selection listSource provider selection list

  1. Then, in the Repository URL field, enter the SSH address of your CodeCommit repository:

CodeCommit repository detailsCodeCommit repository details

  1. Now we need to authenticate Buddy in your AWS account. To do that, download the SSH key displayed on the creation screen:

Custom repository configuration screenCustom repository configuration screen

  1. Log in to your Amazon IAM settings and add the key by clicking Upload SSH public key:

CodeCommit security credentialsCodeCommit security credentials

Once you add the key, you should see something like this:

CodeCommit keys listCodeCommit keys list

  1. Now, copy the key ID and paste it at the beginning of the repository URL in the following format (see point 3 for comparison):
ssh://SSH_KEY_ID@repository_ssh_url

Repository address with SSH key IDRepository address with SSH key ID

  1. Click Create a new project to finish configuration. After a while, your repository should be successfully synchronized.

Synchronization processSynchronization process

Step 2: Configuring repository webhook

  1. The last step is making sure that Buddy is informed about changes pushed to your CodeCommit repository. Go to your repository settings on AWS and click NotifyCreate notification rule:

Creating AWS notification ruleCreating AWS notification rule

Enter the name and configure the details according to the screenshot below. Select SNS Topic as the target and click Submit when ready:

AWS notification rule configurationAWS notification rule configuration

SNS is a tool used by Amazon to send notifications. If you don't have any topic configured, you need to create it first.

Notification rule settings:

# Detail type:
- Full
# Events:
- Comments: On commits, On pull requests
- Branches and tags: Created, Deleted, Updated
  1. With the rule configured, go to the Project options in Buddy and switch to the Repository tab. The tab displays synchronization details and webhooks logs (once configured). Copy the refresh webhook – we will need it shortly:

Repository tab in the project settingsRepository tab in the project settings

  1. Go back to Amazon and switch to the Simple Notification Service (SNS). Look up the topic that you created, click Create subscription, and paste the webhook from Buddy in the Endpoint field:

Amazon SNS subscription creationAmazon SNS subscription creation

  1. With the subscription created, go back to the Repository tab in your project options on Buddy. You should see a registered webhook from Amazon. Copy the address from the "SubscribeURL" line of the webhook log and open it in your browser. This operation will confirm the topic.

Registered webhook with subscription addressRegistered webhook with subscription address

  1. Finally, you can check if everything is working in the Amazon console:

Subscriptions in the AWS consoleSubscriptions in the AWS console

Congratulations! You have successfully integrated your AWS CodeCommit repository with Buddy! 🍾

Related read

  • Deployment to AWS – learn how to configure a deployment pipeline to EC2, S3, Elastic Beanstalk, CodeDeploy, and Lambda services.
  • AWS integration – learn how to properly integrate Amazon services with Buddy using access & secret keys, or role assumption.
  • AWS policies – the list of policies required by Buddy to integrate with AWS