Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try and fix group membership #10

Merged
merged 20 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ A module that will configure an EKS cluster and the required IAM role and permis
### Spot Fleet
A module to configure spot fleets and acceptable spot server types that can be used with the EKS module. A future enhancement will be to also leverage Karpenter to help with autoscaling.


### VPC
A module that will configure the VPC and subnets (based on the amount of AZs in that region). Also has an option to configure a NAT gateway.

4 changes: 2 additions & 2 deletions modules/iam_identity_users/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ resource "aws_identitystore_user" "this" {
resource "aws_identitystore_group_membership" "this" {
for_each = var.users
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
group_id = aws_identitystore_group.this[each.value.group].id
member_id = aws_identitystore_user.this[each.key].id
group_id = aws_identitystore_group.this[each.value.groups].id
member_id = aws_identitystore_user.this[each.key].user_id
}
3 changes: 2 additions & 1 deletion modules/iam_identity_users/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ variable "users" {
type = map(object({
first_name = string
last_name = string
groups = set(string) # Set of group names the user belongs to
# TODO: add support in case a user needs to belong to multiple groups
groups = string
}))
}

Expand Down
6 changes: 3 additions & 3 deletions users.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module "users" {
source = "./modules/iam_identity_users"
groups = ["administrators", "developers", "qa", "networking"]
groups = ["administrators", "developers", "networking"]

users = {
"Zach Rundle" = {
first_name = "Zach"
last_name = "Rundle"
groups = ["administrators"]
groups = "administrators"
},
"Maverick Dog" = {
first_name = "Maverick"
last_name = "Dog"
groups = ["developers", "qa"]
groups = "developers"
},
}
}