SSH
Terrakube can use SSH keys to authenticate to your private repositories. The SSH keys can be uploaded inside the settings menu.
![](https://docs.terrakube.io/~gitbook/image?url=https%3A%2F%2F4014930676-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MfAN3V983Y82_trlbcu%252Fuploads%252FRlLJysxzfu7nX5g7RfBJ%252Fimage.png%3Falt%3Dmedia%26token%3D3ca39d31-6669-4237-92e5-d5db86181b04&width=768&dpr=4&quality=100&sign=9b0e7c7d&sv=1)
To handle SSH keys inside Terrakube your team should have "Manage VCS settings" access
![](https://docs.terrakube.io/~gitbook/image?url=https%3A%2F%2F4014930676-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MfAN3V983Y82_trlbcu%252Fuploads%252F8O4wnUOwAEwSXl3BRzsL%252Fimage.png%3Falt%3Dmedia%26token%3D8aaa82f0-8fc4-47b2-9755-c0afd2bc47de&width=768&dpr=4&quality=100&sign=43a8cf9b&sv=1)
Terrakube support keys with RSA and ED25519
![](https://docs.terrakube.io/~gitbook/image?url=https%3A%2F%2F4014930676-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MfAN3V983Y82_trlbcu%252Fuploads%252Fvw1c3L3jEYqGWbASynAO%252Fimage.png%3Falt%3Dmedia%26token%3D36356694-c802-47d7-acdd-9858b69feb0a&width=768&dpr=4&quality=100&sign=4b3198d9&sv=1)
SSH keys can be used to authenticate to private repositories where you can store modules or workspaces
Once SSH keys are added inside your organization you can use them like the following example:
Modules:
![](https://docs.terrakube.io/~gitbook/image?url=https%3A%2F%2F4014930676-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MfAN3V983Y82_trlbcu%252Fuploads%252FGagFrKxJiRuXxaS6T8p6%252Fimage.png%3Falt%3Dmedia%26token%3D3974b533-1121-4d34-89da-a3ac7be25d1f&width=768&dpr=4&quality=100&sign=1d772d04&sv=1)
Workspace:
![](https://docs.terrakube.io/~gitbook/image?url=https%3A%2F%2F4014930676-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MfAN3V983Y82_trlbcu%252Fuploads%252FSwONPwsiqi4NOq0zBoKQ%252Fimage.png%3Falt%3Dmedia%26token%3D894b58f8-e36b-4628-8778-dbf9eed54431&width=768&dpr=4&quality=100&sign=b546e039&sv=1)
When using SSH keys make sure to use your repository URL using the ssh format. For github it is something like git@github.com:AzBuilder/terrakube-docker-compose.git
SSH Key Injection
The selected SSH key will be used to clone the workspace information at runtime when running the job inside Terrakube, but it will also be injected to the job execution to be use inside our terraform code.
For example if you are using a module using a GIT connection like the following:
When running the job, internally terraform will be using the selected SSH key to clone the necesary module dependencies like the below image:
![](https://docs.terrakube.io/~gitbook/image?url=https%3A%2F%2F4014930676-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MfAN3V983Y82_trlbcu%252Fuploads%252FmGFLJnSQRGmhayqWa9uS%252Fimage.png%3Falt%3Dmedia%26token%3D0cbde0b3-4a8c-42fa-9c50-7d9bf3857338&width=768&dpr=4&quality=100&sign=9e308bb6&sv=1)
When using a VCS connection you can select wich SSH key should be injected when downloading modules in the workspace settings:
![](https://docs.terrakube.io/~gitbook/image?url=https%3A%2F%2F4014930676-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MfAN3V983Y82_trlbcu%252Fuploads%252Fbw157dNM7AOyCvSVqqn6%252Fimage.png%3Falt%3Dmedia%26token%3D356ef4fb-91db-4ed4-a20c-0dfa6f04e60b&width=768&dpr=4&quality=100&sign=85fdb8af&sv=1)
This will allow to use modules using the git format inside a workspace with VCS connection like the following:
Last updated