What command line option and environment variables control how terraform finds keys for downloading modules from git?
When using terraform modules from a git repo I'm running into problems when I execute the plan via jenkins build server.
I'm using modules with a source like this:
source = "git@github.com:mygroup/myrepo.git//mymodule"
Which results in the following as the private / deploy key isn't in the jenkins user's home/.ssh dir
Permission denied (publickey).
fatal: Could not read from remote repository.
I can use a WithEnv(["HOME=dir"]) clause and build up a .ssh directory but I think there must be a more elegant withCredential + command line option to handle this scenario.
Do you know of a better approach?
Thanks