Skip to content

Commit

Permalink
add group changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachrundle committed Aug 22, 2024
1 parent 8107edb commit ebbfde1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/iam_identity_users/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ data "aws_ssoadmin_instances" "this" {}

# Create SSO Groups
resource "aws_identitystore_group" "this" {
for_each = { for group_name in toset(flatten([for user in values(var.users) : user.groups])) : group_name => group_name }
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
display_name = "MyGroup"
description = "Some group name"
}


resource "aws_identitystore_group" "this" {
for_each = { for group_name in var.groups : group_name => group_name }
display_name = each.value
description = format("SSO group for %s", each.value)
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
Expand Down
6 changes: 6 additions & 0 deletions modules/iam_identity_users/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ variable "email_domain" {
description = "Domain used for user email accounts"
type = string
default = "example.com"
}

variable "groups" {
description = "List of IAM identity center groups to create"
type = set(string)
default = []
}

0 comments on commit ebbfde1

Please sign in to comment.