You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Consider SSO enabled Env0 org. Env0 to my knowledge does not use SCIM at the moment, so the Teams are being populated to Env0 only when a first member of corresponding IdP group log in for the first time. Until then the team does not exists.
Consider a TF module that's used to create Env0 projects and assign permissions to corresponding teams. Such a module would accept a list of group names, which may include groups names that doesn't yet exists as Env0 Teams.
Trying to do something like this in that case would fail:
data "env0_team" "compartment_admins" {
for_each = toset(local.okta_admin_groups)
name = each.key
}
The error would be something like
╷
│ Error: Could not find an env0 team with name <redacted>
│
│ with data.env0_team.compartment_admins["<redacted>"],
│ on env0_project_policy.tf line 1, in data "env0_team" "compartment_admins":
│ 1: data "env0_team" "compartment_admins" {
│
╵
Describe the solution you'd like
There needs to be a way to account for a fact that the team might not exist yet, so the code would not fail and process other groups that do. Maybe env0_teams data source needs to be able to provide some kind of filter as an input, but there needs to be corresponding API endpoint otherwise if TF providers would do the filtering client-side - that wouldn't actually solve anything.
Describe alternatives you've considered
As a workaround I considered the following approach
data "env0_teams" "all_teams" {}
data "env0_team" "compartment_admins" {
for_each = toset([
for group in data.env0_teams.all_teams.names : group
if contains(local.okta_admin_groups, group)
])
name = each.value
}
The downside is that env0_teams data source trying to get a list of all teams in the org, which is excessive and unnecessary. Additionally, it fails agains another issue described in #981
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
I'm trying to understand the request. And what would be the best solution for your requirements.
Please note that teams pagination is resolved.
We could add a filter to data "env0_teams" - would that help?
Is your feature request related to a problem? Please describe.
Consider SSO enabled Env0 org. Env0 to my knowledge does not use SCIM at the moment, so the Teams are being populated to Env0 only when a first member of corresponding IdP group log in for the first time. Until then the team does not exists.
Consider a TF module that's used to create Env0 projects and assign permissions to corresponding teams. Such a module would accept a list of group names, which may include groups names that doesn't yet exists as Env0 Teams.
Trying to do something like this in that case would fail:
The error would be something like
Describe the solution you'd like
There needs to be a way to account for a fact that the team might not exist yet, so the code would not fail and process other groups that do. Maybe
env0_teams
data source needs to be able to provide some kind of filter as an input, but there needs to be corresponding API endpoint otherwise if TF providers would do the filtering client-side - that wouldn't actually solve anything.Describe alternatives you've considered
As a workaround I considered the following approach
The downside is that
env0_teams
data source trying to get a list of all teams in the org, which is excessive and unnecessary. Additionally, it fails agains another issue described in #981Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: