Skip to content
GantryCD

Terraform provider

The GantryCD provider lets OpenTofu manage GantryCD itself. It supports stacks, contexts, runner groups, cloud access, roles, service accounts, and related settings.

Add it like any other provider:

terraform {
  required_providers {
    gantrycd = {
      source = "gantrycd/gantrycd"
    }
  }
}

provider "gantrycd" {}

The provider reads these variables when they are not set in the provider block:

GANTRYCD_API_URL
GANTRYCD_ORG_ID
GANTRYCD_PAT

Set them when running OpenTofu outside GantryCD.

Inside a GantryCD deployment, no token setup is needed. The runner sets the variables with a short-lived token for the stack’s service account. Roles on that account decide which GantryCD resources the code may change.

Use a normal service account token for OpenTofu that runs in another CI system. Do not put the token in .tf files or state.

The provider source, examples, and current resource schemas are in terraform-provider-gantrycd.

For a common use of the provider inside GantryCD, see Stacks of stacks.