Connecting your Terraform enabled repos

This shows you how to connect your GitLab or Github repos to Terracotta AI in a jiffy.

Terracotta AI supports both GitLab and GitHub integrations. This guide walks through connecting your GitLab account and onboarding your Terraform or CDK for Terraform (CDK-TF) repositories.

🔗 Connecting GitHub to Terracotta

When you sign up for a new account, you’ll be prompted to connect your GitHub or GitLab account.

You will be redirected to either GitLab or GitHub, where you will authorize Terracotta AI as an app within your organization. From here, select whichever Terraform or CDK-TF-enabled repos you're choosing.

You will be redirected back to the Terracotta AI app, which you can now begin using by opening a PR in whichever repo you've chosen.

It's that simple. We will automatically recognize that Terraform or CDK-TF exists in your repo and will init, plan and review your changes in real-time.


Adding new repos to Terracotta

If you'd like to add new Terraform or CDK-TF repos into Terracotta AI, select the gear icon in the top right of the app. You'll be taken to the GitHub or GitLab app page, where you can add or remove repos of your choosing.



🔗 Connecting GitLab to Terracotta

When you sign up for a new Terracotta AI account, you'll be prompted to connect your GitLab or GitHub account.

  1. Choose GitLab when prompted.

  2. You will be redirected to GitLab to authorize Terracotta AI as an application.

  3. Approve the requested scopes so Terracotta can:

    • Read repository files
    • Access merge requests
    • Comment on diffs
    • Read CI/CD configuration (optional for some features)
  4. After approval, you'll be redirected back to Terracotta.

  5. Select the Terraform/CDK-TF repos you want Terracotta AI to monitor.


🚀 Using Terracotta with GitLab

Once setup is complete:

  • Open a merge request in any connected repo
  • Terracotta will automatically detect your Terraform or CDK-TF files
  • It will run init, plan, and provide full AI-based review feedback directly on the merge request diff

You don’t need to manually configure detection—Terracotta auto-discovers .tf and .ts IaC files during indexing.


➕ Adding More Repos Later

To add more GitLab repositories after initial onboarding:

  1. Click the gear icon in the top right corner of the Terracotta UI.
  2. You'll be redirected to the GitLab App Management page.
  3. Select additional repos you want to enable.
  4. Changes will sync automatically with your Terracotta account.

✅ That's It!

You're now ready to:

  • Trigger tc:review, tc:plan, tc:guard, or tc:drift in your GitLab MRs
  • Receive full inline review feedback, security findings, cost analysis, and policy validation

Need help? Contact [email protected]