Teleport 16: Advancing Infrastructure Defense in Depth with Device Trust, MFA, and VNET
Jul 25
Register Today
Teleport logoTry For Free
Fork me on GitHub


Reference for the teleport_login_rule Terraform resource

Example Usage

# Teleport Login Rule resource

resource "teleport_login_rule" "example" {
  metadata = {
    description = "Example Login Rule"
    labels = {
      "example" = "yes"

  version  = "v1"
  priority = 0
  traits_map = {
    "logins" = {
      values = [
    "groups" = {
      values = [



  • priority (Number) Priority is the priority of the login rule relative to other login rules in the same cluster. Login rules with a lower numbered priority will be evaluated first.
  • version (String) Version is the resource version.


  • metadata (Attributes) Metadata is resource metadata. (see below for nested schema)
  • traits_expression (String) TraitsExpression is a predicate expression which should return the desired traits for the user upon login.
  • traits_map (Attributes Map) TraitsMap is a map of trait keys to lists of predicate expressions which should evaluate to the desired values for that trait. (see below for nested schema)

Nested Schema for metadata


  • name (String) Name is an object name


  • 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 traits_map


  • values (List of String)