-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support git ssh key authentication #176
Comments
Not sure this answers your request, but for fetching modules using ssh you can add
and then point the source of the module to a ssh git endpoint where the module resides.
|
Oh I see, that's great, thanks! I'll close this for now then and try that out. |
Thanks for the workaround @psalaberria002! I'm going to re-open this because it would still be a good feature though. |
I'm going to close this because for modules, there is a solution outlined above and otherwise I think it makes sense that Atlantis clones the repos using https and the credentials already given to it for making API calls to the VCS system. |
+1, those solutions work for me! |
@psalaberria002 where would I add in the first configuration snippet mentioned in #176 (comment)? |
GIT_SSH_COMMAND is an environment variable @robatwave |
@psalaberria002 I know, but your snippet seemed to imply it being defined in atlantis.yaml somehow, and I can't seem to find reference to that capability in the documentation, so I'm missing the context as to where exactly that code snippet is supposed to go? |
It's a snippet taken from a Kubernetes deployment env section. It's not part of any atlantis yaml. |
If you are using the helm chart you can override the gitconfig
|
I would like to +1 for adding SSH support to atlantis, but am OK with the workaround. Can somebody tell me what i am doing wrong? You can see the
But when i
I can confirm that |
@karl-tpio You wrapped the environment variable value with double quotes. That's the issue.
|
@psalaberria002 Doh. good catch. removed the "" from my docker env file and all is good in the world. :). |
Possible implementation: https://gist.github.com/sryabkov/39f20f263c5edfa650522c6a2e9484b6 |
For all the users of the https://github.com/terraform-aws-modules/terraform-aws-atlantis
|
I would like to propose a |
I think we want something that can be specified on a per use case basis. The problem with a global setting is that this will not work work well if you rely on |
Actually this setting would be only useful in scenario when organisation has enforced cloning over ssh from internal git service - it would not block cloning external terraform modules - because the Morivation: |
For anyone struggling with getting Atlantis to clone over SSH because HTTP endpooint is disabled, both the [url "git@gitlab.yourorg.com:"]
insteadOf = https://<gitlab_user>:<gitlab_token>@gitlab.yourorg.com Notice here, contrary to all the examples, the export GIT_SSH_COMMAND="ssh -i /home/atlantis/.ssh/yourkey.pem -o 'StrictHostKeyChecking no'" It is quite surprising that such an important feature is missing from Atlantis, took a lot of effort to figure this out. |
I use the following which works locally for me as well as in Atlantis v0.20.1 using module "private_submodule" {
source = "git::ssh://git@github.com/<org>/<repo>//modules/<some-module-name>?ref=v1.2.3"
} |
I just hit some issue with terraform 1.6 where Got it to work again by using |
For anyone else coming over to look for support in setting up SSH to work this is how I did address the setup while using helm deployment. Outline is:
That is what we get
Once that is added I define the ENV var for SSH command.
Now in my case there is external operator that streams in the secrets ENV vars into the container and then the postStart hook just takes it over and reconfigure as needed. |
Currently, Atlantis clones git repos with the https remote.
It would be great if Atlantis also supported ssh remotes with ssh key authentication.
The text was updated successfully, but these errors were encountered: