Skip to content

Commit b4c65a3

Browse files
fix: Merge Managed and Unmanaged Users
- The input variable `existing_sso_users`, while present, was previsously unused. This includes it into a new merged collection that then updates managed as well as unmanaged user memberships.
1 parent f859d0c commit b4c65a3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

locals.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# - Users and Groups -
22
locals {
3-
# Create a new local variable by flattening the complex type given in the variable "sso_users"
3+
# To support both managed and federated identities, let's combine the two user collections.
4+
sso_users = merge(var.sso_users, var.existing_sso_users)
5+
6+
# Create a new local variable by flattening the complex type given in the local aggregated variable "sso_users"
47
flatten_user_data = flatten([
5-
for this_user in keys(var.sso_users) : [
6-
for group in var.sso_users[this_user].group_membership : {
7-
user_name = var.sso_users[this_user].user_name
8+
for this_user in keys(local.sso_users) : [
9+
for group in local.sso_users[this_user].group_membership : {
10+
user_name = local.sso_users[this_user].user_name
811
group_name = group
912
}
1013
]

0 commit comments

Comments
 (0)