mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-03 07:40:28 +08:00
* copy terraform provider * Make dependecy checker happy + use go 1.22 * Run terraform tests in the CI, add Makefile target * go mod tidy
36 lines
745 B
Plaintext
36 lines
745 B
Plaintext
# 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
|
|
token_id = teleport_provision_token.bot_example.metadata.name
|
|
roles = ["access"]
|
|
}
|