Docs

CI Uploads

Keep Cora up to date by streaming Terraform state from CI. Works with GitHub Actions, Atlantis, and any CI system.

You don't need to change your Terraform backend to use Cora. The simplest way to keep diagrams and history current is to stream your latest Terraform state to Cora after each apply.

The Core Pattern

After a successful apply, run Terraform's JSON export and pipe it into the Cora CLI. Use a stable workspace name so Cora can group state updates consistently.

bash
terraform state pull | cora upload --workspace <workspace name>
Workspace naming

Set --workspace to something stable and human-readable, like networking or production-app. If you have multiple accounts/environments, include them in the name (for example, prod/networking).

Step 0: Create a Token

CI uploads should use an API token, not a user session. Create a token in the Cora UI and store it as a secret in your CI system.

  1. Go to Settings → Tokens in your Cora account.
  2. Create a new token for CI (name it after the repo/environment).
  3. Save the token value into your CI secrets store (GitHub Actions Secrets, Terraform Cloud variables, etc.).
Security notes
  • Never commit the token to your repo.
  • Rotate tokens like any other production secret.
  • Prefer environment-scoped tokens (for example, separate tokens for staging vs production).

GitHub Actions Example

This example runs after terraform apply and streams the updated state to Cora.

.github/workflows/terraform.yml
# .github/workflows/terraform.yml
# ...after your apply step

- name: Upload state to Cora
env:
  CORA_TOKEN: ${{ secrets.CORA_TOKEN }}
run: |
  terraform state pull | cora upload --workspace production/networking

If your CLI uses a different env var name, set it here. The important part is that the upload runs only after a successful apply.

Atlantis Workflow

Atlantis already standardizes plan/apply. Cora fits naturally as a post-apply step:

  1. Atlantis runs apply.
  2. After apply, export the state as JSON from the same working directory.
  3. Pipe the JSON to Cora using a stable workspace name.
bash
terraform state pull | cora upload --workspace <workspace name>
Tip

If you run multiple Terraform projects through Atlantis, set the workspace name from repo + directory (for example, prod/vpc or staging/eks) so each graph stays scoped.

For full Atlantis configuration, see the Atlantis Integration guide.