Ignitify.dev
ignitify_whoami
Terraform

ignitify_whoami

A data source. It reads the tenant, the calling key, the permissions it holds, the limits of your plan and what the tenant holds now. It works with any key.

Example

main.tf
data "ignitify_whoami" "me" {}

# Stop early when the configuration needs an owner key.
check "owner_key" {
  assert {
    condition     = data.ignitify_whoami.me.is_owner_key
    error_message = "This configuration manages access and needs an owner key."
  }
}

Attributes

Every attribute is read-only. The data source has no arguments.

NameTypeUseMeaning
tenant_idStringRead-onlyThe tenant id.
tenant_nameStringRead-onlyThe tenant name.
statusStringRead-onlyThe tenant status.
tier_nameStringRead-onlyThe tenant's plan.
tier_versionNumberRead-onlyThe version of the plan.
key_idStringRead-onlyThe resource id of the calling key.
is_owner_keyBooleanRead-onlyWhether the calling key is an owner key.
userStringRead-onlyThe user that holds the calling key. Null for an owner key.
groupsSet of StringRead-onlyThe groups of the key's user.
permissionsSet of StringRead-onlyThe permissions the key holds.
limitsObjectRead-onlyThe limits of your plan. A null limit is unlimited. See below.
usageObjectRead-onlyWhat the tenant holds now. See below.

limits

NameTypeUseMeaning
max_tasksNumberRead-onlyMost tasks.
max_running_vmsNumberRead-onlyMost VMs running at once.
max_pinned_vmsNumberRead-onlyMost pinned VMs.
max_unitsNumberRead-onlyMost run units in use at once.
max_storage_mibNumberRead-onlyScratch storage per run, in MiB.
max_total_image_bytesNumberRead-onlyMost bytes in the image store.
max_payload_bytesNumberRead-onlyMost bytes passed into a task. The same for every tenant.
max_result_bytesNumberRead-onlyMost bytes a task sends back. The same for every tenant.

usage

NameTypeUseMeaning
task_countNumberRead-onlyTasks.
deployment_countNumberRead-onlyDeployments.
active_runsNumberRead-onlyActive runs.
active_unitsNumberRead-onlyRun units in use.
pinned_vmsNumberRead-onlyPinned VMs.
total_image_bytesNumberRead-onlyBytes in the image store.

Check a limit before you apply

A check block shows a warning in the plan. It does not stop the apply.

main.tf
# Warn, with a clear message, when no task slot is free.
check "task_slot" {
  assert {
    condition = (
      data.ignitify_whoami.me.limits.max_tasks == null ||
      data.ignitify_whoami.me.usage.task_count < data.ignitify_whoami.me.limits.max_tasks
    )
    error_message = "The plan has no free task slot."
  }
}