Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,65 @@ This page describes the supported values of the teleport_bot resource of the Tel
```hcl
# Teleport Machine ID Bot creation example

locals {
bot_name = "example"
}

resource "random_password" "bot_token" {
length = 32
special = false
}

resource "time_offset" "bot_example_token_expiry" {
offset_hours = 1
}

resource "teleport_provision_token" "bot_example" {
resource "teleport_bot" "example" {
metadata = {
expires = time_offset.bot_example_token_expiry.rfc3339
description = "Bot join token for ${local.bot_name} generated by Terraform"

name = random_password.bot_token.result
name = "example"
}

spec = {
roles = ["Bot"]
bot_name = local.bot_name
join_method = "token"
roles = ["access"]
}
}

resource "teleport_bot" "example" {
name = local.bot_name
roles = ["access"]
}
```

{/* schema generated by tfplugindocs */}
## Schema

### Required
### Optional

- `metadata` (Attributes) 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) 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.

- `name` (String) The name of the bot, i.e. the unprefixed User name
### Read-Only

- `role_name` (String, Deprecated) The name of the generated bot role
- `status` (Attributes) 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.

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

- `token_id` (String, Sensitive) Deprecated. This field is not required anymore and has no effect.
- `token_ttl` (String) Deprecated. This field is not required anymore and has no effect.
- `traits` (Map of List of String)

### Read-Only
### Nested Schema for `status`

Read-Only:

- `role_name` (String) The name of the generated bot role
- `user_name` (String) The name of the generated bot user
- `role_name` (String) The name of the role associated with the bot.
- `user_name` (String) The name of the user associated with the bot.
29 changes: 3 additions & 26 deletions integrations/terraform/examples/resources/teleport_bot/resource.tf
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
# Teleport Machine ID Bot creation example

locals {
bot_name = "example"
}

resource "random_password" "bot_token" {
length = 32
special = false
}

resource "time_offset" "bot_example_token_expiry" {
offset_hours = 1
}

resource "teleport_provision_token" "bot_example" {
resource "teleport_bot" "example" {
metadata = {
expires = time_offset.bot_example_token_expiry.rfc3339
description = "Bot join token for ${local.bot_name} generated by Terraform"

name = random_password.bot_token.result
name = "example"
}

spec = {
roles = ["Bot"]
bot_name = local.bot_name
join_method = "token"
roles = ["access"]
}
}

resource "teleport_bot" "example" {
name = local.bot_name
roles = ["access"]
}
Loading
Loading