Skip to content

Commit ebbfde1

Browse files
committed
add group changes
1 parent 8107edb commit ebbfde1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

modules/iam_identity_users/main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ data "aws_ssoadmin_instances" "this" {}
33

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

11+
12+
resource "aws_identitystore_group" "this" {
13+
for_each = { for group_name in var.groups : group_name => group_name }
814
display_name = each.value
915
description = format("SSO group for %s", each.value)
1016
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]

modules/iam_identity_users/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ variable "email_domain" {
1111
description = "Domain used for user email accounts"
1212
type = string
1313
default = "example.com"
14+
}
15+
16+
variable "groups" {
17+
description = "List of IAM identity center groups to create"
18+
type = set(string)
19+
default = []
1420
}

0 commit comments

Comments
 (0)