Reference for the teleport_bot Terraform resource
Example Usage
# 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" {
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
}
spec = {
roles = ["Bot"]
bot_name = local.bot_name
join_method = "token"
}
}
resource "teleport_bot" "example" {
name = local.bot_name
roles = ["access"]
}
Schema
Required
name
(String) The name of the bot, i.e. the unprefixed User nameroles
(List of String) A list of roles the created bot should be allowed to assume via role impersonation.
Optional
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
role_name
(String) The name of the generated bot roleuser_name
(String) The name of the generated bot user