Skip to content

Commit

Permalink
fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
zachrundle committed Aug 21, 2024
1 parent 5eb131e commit 8107edb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions modules/iam_identity_users/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ resource "aws_identitystore_user" "this" {

# Assign Users to Groups
resource "aws_identitystore_group_membership" "this" {
for_each = { for user_key, user in var.users : user_key => { for group_name in user.groups : group_name => aws_identitystore_group.this[group_name].id } }
for_each = {
for user_key, user in var.users :
user_key => {
for group_name in user.groups :
format("%s-%s", user_key, group_name) => {
group_id = aws_identitystore_group.this[group_name].id,
member_id = aws_identitystore_user.this[user_key].id,
}
}
}

identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
group_id = each.value[group_name]
member_id = aws_identitystore_user.this[each.key].id
group_id = each.value.group_id
member_id = each.value.member_id
}

0 comments on commit 8107edb

Please sign in to comment.