Terraform provider reference / resources / project_token

fiberax_project_token (Resource)

A key of one project, issued with an account key - for example for a customer of yours or for a pipeline that must see one project only. Destroying the resource revokes the key.

The secret is kept in state (secret, sensitive): the platform shows it once, when the key is issued. After an import it is empty; a new secret means a new key (terraform apply -replace). Every field replaces the key: a key cannot be changed, only revoked and issued again.

A key issued this way works only while the account key that issued it works: revoking that account key in the client area revokes these keys too. A key that is revoked or has expired drops out of state on the next plan, and apply issues a new one. Up to 25 active client keys per project, names unique among them; no e-mail is sent about keys issued through the API.

Example Usage

# A key of one project, issued with an account key - for a customer of yours or for a
# pipeline that must see this project only. The secret is kept in state (sensitive).
resource "fiberax_project" "acme" {
  name = "acme-production"
}

resource "fiberax_project_token" "acme_ci" {
  project_id      = fiberax_project.acme.id
  name            = "acme ci"
  scope           = "rw"
  expires_in_days = 90
}

# Hand the secret over through your secret store; never print it.
output "acme_ci_token" {
  value     = fiberax_project_token.acme_ci.secret
  sensitive = true
}

Schema

Required

Optional

Read-Only

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# A project key is imported as <project ID>,<key ID>; the key ids are in
# GET /v1/projects/{id}/tokens. The secret is not shown again, so after import it is empty.
terraform import fiberax_project_token.acme_ci 4711,815

Generated from the provider schema for version 0.11.0. How to install the provider: Terraform provider.