gravitational/teleport-plugins

Incorrect documentation for Terraform teleport_role resource

Nuru opened this issue · 2 comments

Nuru commented

The Terraform teleport_role documentation documents app_labels like this:

image

This means (to me, anyway) that you should set app_labels like this:

app_labels = [{
  key = "example"
  values = ["a", "b"]
},
{ 
  key = "other"
  values = ["1", "2"]
}]

However, in provider terraform.releases.teleport.dev/gravitational/teleport v11.0.1, this is far from how you actually need to set the field. It appears the correct syntax for the above settings is:

app_labels = {
  key = ["example"]
  values = ["a", "b"]
}
app_labels = { 
  key = ["other"]
  values = ["1", "2"]
}

except that does not work because this is inside a map and the second app_labels key overwrites the first.

This applies to the other *_labels settings as well.

Note that rules is also documented to be a set, but that is correct. This works as expected:

rules = [{
  resources = ["*"]
  verbs     = ["*"]
}]

Can you please try the following syntax?

      node_labels = {
        example    = ["1", "2"]
        other    = ["1", "2"]
      }
Nuru commented

Alright, that works, I see what the docs were trying to say now. An example in the docs would have cleared up the confusion.