Ignitify.dev
ignitify_api_key
Terraform

ignitify_api_key

An API key of a user. Needs an owner key. The raw key is stored in the state as a sensitive value. A user key never expires: destroy the resource to revoke it.

Example

access.tf
resource "ignitify_api_key" "ci" {
  user  = ignitify_user.ci.name
  label = "ci-pipeline"
}

# The raw key is in the state as a sensitive value.
# Pass it to a secret store. Never print it.
output "ci_key" {
  value     = ignitify_api_key.ci.raw_key
  sensitive = true
}

Arguments and attributes

NameTypeUseMeaning
userStringRequiredforces replacementThe name of the user that holds the key.
labelStringRequiredforces replacementA label for the key. 1 to 64 letters, digits, ., _ and -, not starting or ending with -.
raw_keyStringRead-onlysensitiveThe key itself. The server shows it once, at create. Empty after an import.
created_atStringRead-onlyWhen the key was created (ISO 8601).
resource_idStringRead-onlyimport idThe server id of the key.

Behaviour

  • A new user or label replaces the key, and the new key has a new value. Update the place where you stored the old one.
  • A user key never expires. To rotate it, replace the resource: terraform apply -replace=ignitify_api_key.ci.
  • The plan of your tier caps the number of keys. A create above the cap fails at once with a plan-limit error.

Import

The import id is the resource_id of the key. After an import, raw_key is empty, because the server cannot show it again.

terminal
$ terraform import ignitify_api_key.ci <resource_id>