terraform-provider-zitadel icon indicating copy to clipboard operation
terraform-provider-zitadel copied to clipboard

Datasource Zitadel project roles

Open DoGab opened this issue 10 months ago • 0 comments

Preflight Checklist

  • [X] I could not find a solution in the existing issues, docs, nor discussions
  • [X] I have joined the ZITADEL chat

Describe your problem

We would like to query Zitadel for all project roles so that we can assign them without knowing the role names previously.

Describe your ideal solution

There is a datasource which makes it possible to query for roles in a specific project. I could imagine following features:

  • Getting all roles of a project without providing a name
  • Getting all roles of a project in a specific group
  • Getting all roles of a project by name

All roles:

data "zitadel_projects" "default" {
  org_id      = data.zitadel_org.default.id
  project_id  = data.zitadel_project.default.id
}

Roles in a group:

data "zitadel_projects" "default" {
  org_id       = data.zitadel_org.default.id
  project_id   = data.zitadel_project.default.id
  group        = "api"
  group_method = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE"
}

Roles with name:

data "zitadel_projects" "default" {
  org_id      = data.zitadel_org.default.id
  project_id  = data.zitadel_project.default.id
  name        = "api"
  name_method = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE"
}

For us the most important would be the first one.

Version

1.1.1

Additional Context

No response

DoGab avatar Apr 18 '24 05:04 DoGab