Introduction
This document explains how to connect to an AWS CodeCommit repository from the Denodo Platform using the different methods offered by CodeCommit. AWS CodeCommit is a secure, highly scalable, fully managed source control service that hosts private Git repositories.
Repository Creation
To create a repository in AWS CodeCommit, log in to the AWS Console and browse to the CodeCommit Service.
Create a new repository and provide a name, for example denodo-repo.
Once the repository is created we have to configure a user to access the repository.
CodeCommit Configuration
The first step is to choose the IAM user you want to configure for CodeCommit access and grant the necessary privileges. For this article, the AWSCodeCommitFullAccess policy has been selected, but there are several other policies depending on the scenario. Refer to the list of policies in the AWS managed policies for CodeCommit.
Connection types
There are three methods of authentication with CodeCommit repositories - HTTPS, SSH and HTTPS (GRC). This article explains how to configure the Virtual DataPort server to connect to CodeCommit via SSH and HTTPS.
HTTPS
- In the IAM console, in the navigation pane, choose Users, and from the list of users, choose your IAM user.
- On the user details page, choose the Security Credentials tab.
- Click on HTTPS Git credentials for AWS CodeCommit, choose Generate.
- Copy the username and password that IAM generated for you, either by showing, copying, and then pasting this information into a secure file on your local computer, or by choosing Download credentials to download this information as a .CSV file. You need this information to connect to CodeCommit.
After you have saved your credentials, choose Close.
NOTE: This is your only chance to save the username and password. If you do not save them, you can copy the user name from the IAM console, but you cannot look up the password. You must reset the password and then save it. |
For the Denodo side, from the Web Design Studio, navigate to the Administration > VCS Management section and provide the URL and user credentials obtained from CodeCommit.
The Environments section will display the environment that we have created.
SSH
The SSH method utilizes the same IAM policies as the HTTPs method. Refer to the list of policies in the AWS managed policies for CodeCommit.
Set up the public and private keys for Git and CodeCommit
- From a command line with administrative privileges run the following commands. In this example, all the commands were executed with Git Bash.
From the command line, run the ssh-keygen command, and follow the directions to save the file to the .ssh directory for your profile.
$ ssh-keygen
This generates:
The id_rsa file, which is the private key file.
The id_rsa.pub file, which is the public key file.
Note that you could rename the files as codecommit_rsa such that it will be unique and need not have to overwrite the existing file if applicable.
- Copy the contents of the public key (.pub file) generated in the previous step:
Upload the SSH Key
- In the IAM console, in the navigation pane, choose Users, and from the list of users, choose your IAM user.
- On the user details page, choose the Security Credentials tab, and then choose Upload SSH public key.
- Paste the contents of your SSH public key into the field, and then choose Upload SSH public key.
- Copy or save the information in SSH Key ID (for example: APKAEIBAERJR2EXAMPLE).
- In the Bash emulator, run the following commands to create a config file in the ~/.ssh directory, or edit it if one already exists:
- notepad ~/.ssh/config
- Add the following lines to the file, where the value for User is the SSH key ID you copied earlier, and the value for IdentityFile is the path to and name of the private key file:
Host git-codecommit.us-east-1.amazonaws.com User APKAXNTMGOLDAZ5BAWGI IdentityFile ~/.ssh/id_rsa |
- If you gave your private key file a name other than id_rsa, be sure to use it here.
- Save the file as config (not config.txt).
- Run the following command to test your SSH configuration:
- ssh git-codecommit.us-east-1.amazonaws.com
- The host could be different based on the region of the repository. For this example, the region is us-east-1
- Output should be similar to the one below:
- From the Virtual DataPort Administration Tool, the URL should be modified with the SSH Key,
ssh://<SSH-Key-ID>@git-codecommit.us-east-1.amazonaws.com/v1/repos/denodo-repo |
At the Authentication section, select Use SSH Keys and the key configured at the previous step will be utilized for this authentication.
References
The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.
For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.