Ignitify.dev
Manage a tenant with Terraform
Terraform

Manage a tenant with Terraform

The Ignitify provider sets up an existing tenant as code, with Terraform or OpenTofu: users, groups, permissions, user keys, secrets, tasks with their code, hooks and recurring schedules. You review a plan, apply it, and the tenant matches your files.

What the provider does and does not do

TopicDetail
It managesUsers, groups with their permissions and members, user keys, secrets, tasks, the code of a task (a deployment), hooks and recurring schedules. It also reads who you are, with a data source.
No tenantThe provider does not create a tenant, change a plan or buy one. A tenant comes from sign-up, and the provider takes a key you already have.
No runsRuns, one-time schedules (task:run --at), VMs and logs are not resources. A run starts from a hook, a recurring schedule (ignitify_schedule), the CLI or the API.

Install

You need Terraform 1.11 or later, or OpenTofu 1.11 or later. The secret resource uses a write-only argument, which older versions do not have. Name the provider in required_providers, then run init. init installs it from the Terraform Registry and checks its signature.

main.tf
terraform {
  required_version = ">= 1.11"
  required_providers {
    ignitify = {
      source = "ignitify-dev/ignitify"
    }
  }
}

provider "ignitify" {}
terminal
$ terraform init

With OpenTofu, run tofu init. Every example in this section works with both tools. The provider reads the key from IGNITIFY_API_KEY. See Provider configuration.

Owner key and user key: two root modules

Users, groups and keys need an owner key. Secrets, tasks, deployments, hooks and schedules work with a user key. Keep them in two separate Terraform root modules, so the daily job never holds the owner key.

  1. access uses the owner key. It makes a user, a group with its permissions and members, and a key for that user.
  2. app is applied by CI with that user key. It manages a task, its code, a hook and a secret.

With a user key, an access resource fails with owner-required. The Users, groups and permissions guide explains the permissions, and Recipes has both modules in full.

The pages of this section

Keep the state safe