When I run terraform plan
, I get errors like:
╷
│ Error: Failed to download module
│
│ Could not download module "foo" (main.tf:123) source code from
│ "git@github.com:my-company/some-repo": error downloading
│ 'ssh://git@github.com/my-company/some-repo': /usr/bin/git exited with 128:
│ Cloning into '.terraform/modules/foo'
│ Host key verification failed.
│ fatal: Could not read from remote repository.
│
│ Please make sure you have the correct access rights
│ and the repository exists.
The Github SSH key is listed in ssh-add -l
and I am able to clone ssh://git@github.com/my-company/some-repo
. The repo is part of my company's Github org, and it requires SSO on Github to access.
I found https://support.hashicorp.com/hc/en-us/articles/360041922633--Host-key-verification-failed-error-in-a-Terraform-Enterprise-run-when-attempting-to-ingress-Terraform-modules-via-Git-over-SSH- but it didn't really help. The page is vague but from what I can tell I've already done everything they suggest.
Does anyone know a solution to this?