# Reference for the teleport\_bot Terraform resource

This page describes the supported values of the teleport\_bot resource of the Teleport Terraform provider.

## Example Usage

```
# Teleport Machine ID Bot creation example

resource "teleport_bot" "example" {
  metadata = {
    name = "example"
  }

  spec = {
    roles = ["access"]
  }
}

```

## Schema

### Optional

- `metadata` (Attributes) Requires provider v18.4.0 or newer. Common metadata that all resources share (see [below for nested schema](#nested-schema-for-metadata))
- `name` (String, Deprecated) The name of the bot, i.e. the unprefixed User name
- `roles` (List of String, Deprecated) A list of roles the created bot should be allowed to assume via role impersonation.
- `spec` (Attributes) Requires provider v18.4.0 or newer. The configured properties of a bot. (see [below for nested schema](#nested-schema-for-spec))
- `sub_kind` (String) Differentiates variations of the same kind. All resources should contain one, even if it is never populated.
- `token_id` (String, Sensitive, Deprecated)
- `token_ttl` (String, Deprecated)
- `traits` (Map of List of String, Deprecated)
- `version` (String) The version of the resource being represented.

### Read-Only

- `role_name` (String, Deprecated) The name of the generated bot role
- `status` (Attributes) Requires provider v18.4.0 or newer. Fields that are set by the server as results of operations. These should not be modified by users. (see [below for nested schema](#nested-schema-for-status))
- `user_name` (String, Deprecated) The name of the generated bot user

### Nested Schema for `metadata`

Required:

- `name` (String) Name is an object name

Optional:

- `description` (String) Description is object description
- `expires` (String) Expires is a global expiry time header can be set on any resource in the system.
- `labels` (Map of String) Labels is a set of labels

### Nested Schema for `spec`

Optional:

- `max_session_ttl` (String) The max session TTL value for the bot's internal role. Unless specified, bots may not request a value beyond the default maximum TTL of 12 hours. This value may not be larger than 7 days (168 hours).
- `roles` (List of String) A list of roles the created bot should be allowed to assume via role impersonation.
- `traits` (Map of List of String) The traits that will be associated with the bot for the purposes of role templating.

Where multiple specified with the same name, these will be merged by the server.

### Nested Schema for `status`

Read-Only:

- `role_name` (String) The name of the role associated with the bot.
- `user_name` (String) The name of the user associated with the bot.
