# clerk_machine (Resource)

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

## Example Usage

```terraform
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 generated by tfplugindocs -->
## 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](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import clerk_machine.worker mch_2abcDEFghiJKLmnoPQRstuVWXyz
```