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
| Topic | Detail |
|---|---|
| It manages | Users, 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 tenant | The 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 runs | Runs, 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.
terraform {
required_version = ">= 1.11"
required_providers {
ignitify = {
source = "ignitify-dev/ignitify"
}
}
}
provider "ignitify" {}$ terraform initWith 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.
- access uses the owner key. It makes a user, a group with its permissions and members, and a key for that user.
- 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
- Provider configuration: Every argument and environment variable, the keys to use, retries and idempotency.
- ignitify_user: A user of the tenant.
- ignitify_group: Permissions and members, with the full list of permissions.
- ignitify_api_key: The key of a user, shown once.
- ignitify_secret: A secret with a write-only value.
- ignitify_task: The name code is deployed under.
- ignitify_deployment: The code of a task: files, build, update rules, slots and the notify callback.
- ignitify_hook: A hook that starts a run.
- ignitify_schedule: A recurring schedule that starts a run at each slot of a cron expression.
- ignitify_whoami: The data source for the tenant, key, limits and usage.
- Recipes: Set up from zero, roll a code update, rotate, import and run from CI.
- Errors and troubleshooting: The reasons the provider acts on, and what to do.