GitLab CI/CD authentication to a different repository using Terrafrom?

Self hosted on premise GitLab environment. I have a group of repositories, where each repository will contain a different terraform resource module. I have another repository that will host the “root module”. I have setup a “deploy token” for the resource module that has read access. How do I setup the root module that is running via Gitlab CI/CD to authenticate to the resource module using the deploy token?

I found the solution myself and figured I would post up here in case others in the future come across this issue:

  1. In your .gitlab-ci-yml file place this line in your “before script” section:
  1. In the repo your reading from, make sure you adjust the “Token Access” to allow the CI/CD for the resource module to allow for the root module CI/CD to read it. Gitlab>Project(repo)>settings>CI/CD>Token Access