Terrafile ssh support

Hey,

We are very strict security rules in our company. We are only allowed to use internal terraform modules (meaning they have to be stored on our on-prem bitbucket server) and we can only access git repos using ssh.

Is there support for this in Terrafile? If so what is the syntax? I tried it with all terraform-style methods I could find and none of them work.

Here are the methods you can use in terraform: https://www.terraform.io/language/modules/sources#generic-git-repository

It would be great if this would also work in Terrafile (or an equivalent).

Errors I get:

(I have to put in “url” instead of an example domain, as the website doesn’t allow me to post more links)

  1. Source: git@url:org/repo.git
    ERROR: git clone git@url:org/repo.git 2>&1
    Cloning into ‘tf-module-tagger’…
    No user exists for uid 1000
    fatal: Could not read from remote repository.

  2. Source: ssh://git@url\org/repo.git
    /var/lib/gems/2.7.0/gems/terraspace-bundler-0.4.3/lib/terraspace_bundler/mod.rb:30:in org': undefined method split’ for nil:NilClass (NoMethodError)
    from /var/lib/gems/2.7.0/gems/terraspace-bundler-0.4.3/lib/terraspace_bundler/mod/fetcher/git.rb:7:in `run’

  3. Source: git::ssh://git@url\org/repo.git
    same output as 2

I hope the error messages are of help. If the full trace of 2 is required, please let me know.

We are running terraspace 1.0.0, btw.

Thanks,
Emanuel

The ssh notation was not supported. So added it:

It was a bit of doozy to implement as it’s about figuring out the edge cases. Added a few specs to help in the future.

Terraspace Docs: https://terraspace.cloud/docs/terrafile/sources/ssh/

Wow, thank you very much! We will update and test it asap! :slight_smile:

Really greatly appreciated!