Circleci gives me Are you sure you want to continue connecting (yes/no/[fingerprint])? when trying to pull from another private repo during terraform init

My job run on 2.0 and I am trying to run a simple terraform pipeline with init, plan… etc… It used to work fine, but we decided to use our modules in a separate repository and they’re both private repositories. Well, the problem is that now during the terraform init command I get an error because it looks like circleci is trying to ssh to the repo and is waiting for an answer to the following:

terraform init .
terraform plan
Initializing modules...
Downloading githubDOTcom/my-modules-repo.git for module_name...

The authenticity of host 'github(140.82.113.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? Step was canceled

By googling it I found a few tricks that could probably solve it, such as including ssh-keyscan 40.89.139.99 >> ~/.ssh/known_hosts or even mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config. None worked for me. In fact, when I include that ip, I receive a new one on the console… so it’s always a different one, which makes me believe it should have a better solution to this.

Here’s my current configuration: (Oh, and since new users can’t post more than two links here, I changed the urls to githubDOTcom

defaults: &defaults
working_directory: /tmp/build
docker:
- image: hashicorp/terraform:light

version: 2
jobs:
checkout:
<<: *defaults
steps:
- checkout
- persist_to_workspace:
root: /tmp/build
paths:
- .

plan_prod:
<<: *defaults
steps:
#- add_ssh_keys:
# fingerprints:
# - “nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8”
- attach_workspace:
at: /tmp/build
#- run:
# name: Avoid hosts unknown for github
# command: mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config
- run:
name: Feature branch terraform plan o
command: |
mkdir ~/.ssh/
ssh-keyscan 140.82.113.3 >> ~/.ssh/known_hosts
ssh-keyscan 192.30.253.112 >> ~/.ssh/known_hosts
ssh-keyscan 140.82.114.4 >> ~/.ssh/known_hosts
#mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config
terraform init .
terraform plan
- persist_to_workspace:
root: /tmp/build
paths:
- .

workflows:
version: 2
Init and Plan:
jobs:
- checkout
- plan_prod:
requires:
- checkout
filters:
branches:
only: ReadmeFiles

Any tips? Thanks.

Nothing? :confused: