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
name(String) Name of the key, unique among the active keys of the project: Latin letters, digits, space, dot, dash and underscore, up to 60 characters. Changing it replaces the key.project_id(Number) The project the key belongs to (fiberax_project.<name>.id). Changing it replaces the key.
Optional
expires_in_days(Number) Lifetime in days: 30, 90 or 365. Not set - the key does not expire. Counted from the moment the key is issued;expires_atshows the date. Changing it replaces the key. The platform does not return this number, so after an import it is taken as written.scope(String)read(the default, as on the platform) orrw- read and write. Changing it replaces the key.
Read-Only
created_at(String) When the key was issued (RFC 3339).expires_at(String) When the key expires (RFC 3339); null - never.id(Number) ID of the key.prefix(String) First characters of the secret, as the client area shows them.secret(String, Sensitive) The key itself,fbx_and 48 hex characters - thetokenof a provider configuration of that project. Set when the key is issued; empty after an import.status(String)active. A revoked or expired key leaves state on the next plan.
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.