SSH Integration
Overview
This guide will help you connect your version control repositories to IaC Cost Tracker by Binadox using SSH authentication. Whether you’re using GitHub, Bitbucket, or other version control systems, this integration enables automatic cost analysis and optimization recommendations for your cloud resources. This guide demonstrates the process using Bitbucket as an example.
Integration Steps
1. Generate a SSH Key Pair
Open a terminal and navigate to your home or user directory using cd.
Generate a SSH key pair using ssh-keygen:
ssh-keygen -t ed25519 -b 4096 -C "username@emaildomain.com" -f ~/.ssh/{ssh-key-name}
- Replace
usernamemaildomain.com
with your email address - Replace
{ssh-key-name}
with a descriptive name (e.g., bitbucket_work). It’s the output filename for the keys.
When prompted to enter a passphrase, you can either provide a password or leave it empty. If you set a password, you’ll need to enter it in step 3.
Once complete, the command will generate two files:
~/.ssh/{ssh-key-name}
– the private key~/.ssh/{ssh-key-name}.pub
– the public key
These files will be stored in your user folder, such as C:\Users\<username>\<ssh-key-name>\
2. Add Your SSH Key to the SSH Agent
Add your private key to the SSH agent using the following command:
ssh-add ~/.ssh/{ssh-key-name}
3. Add Your SSH Public Key to Bitbucket
Log in to Bitbucket. Select the Settings icon in the upper-right corner of the top navigation bar.
Under Personal settings, select Personal Bitbucket settings. In the left sidebar, select SSH keys. Click the Add key button
Give your key a Name (e.g., “Public_Key_Binadox”). Copy the contents of your public key file (~/.ssh/{ssh-key-name}.pub
). Paste the key into the SSH Public Key field. Click the Add key button.
4. Verify SSH Connection
To test that your SSH key was added successfully, open a terminal and run:
ssh -T git@bitbucket.org
If successful, you should see a message similar to:
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled.
5. Get SSH URL for Your Repository
Log in to your version control system. Navigate to your repository. Click the Clone button
Select SSH from the dropdown. Copy the SSH address.
6. Configure Binadox to Connect with Your Repository
Navigate to the IaC Cost Tracker page by selecting it from the left navigation menu. Click the Add project button.
In the Creating New Project dialog box, complete the following fields:
- Project name: Enter a descriptive name that clearly identifies this project within Binadox
- SSH URL: Paste the SSH URL of your repository that you copied in step 5 (without git clone)
- SSH: Enter your private key from step 1
- Password: If you specified a password when creating a key pair, then write it in
Click the Next button.
Select the appropriate branch to track (typically “main” or “master”). Click the Next button.
Select the directory containing your infrastructure code. Click the Create project button.
You’ve successfully integrated with Binadox and can now track infrastructure costs automatically with each code change. For SSH connections, updates occur once daily. If you want to pull data after each commit, use VCS connections with pipeline configuration.