wihan/dev

docs /clerk / resources

markdown
browse the clerk docs

clerk_machine (Resource)

A machine-to-machine identity with its own secret key.

Example Usage

resource "clerk_machine" "worker" {
  name              = "worker"
  default_token_ttl = 3600
}

resource "clerk_machine" "api" {
  name = "api"

  # The api machine can mint tokens for the worker machine.
  scoped_machines = [clerk_machine.worker.id]
}

Schema

Required

  • name (String) Machine name.

Optional

  • default_token_ttl (Number) Default lifetime in seconds for tokens that this machine mints.
  • scoped_machines (Set of String) Ids of the machines this machine can mint tokens for.

Read-Only

  • id (String) Machine id (mch_...).
  • secret_key (String, Sensitive) The machine secret key (mk_...). Store it in a secret manager.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import clerk_machine.worker mch_2abcDEFghiJKLmnoPQRstuVWXyz