Skip to content

Commit

Permalink
Fix main.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
zachrundle committed Aug 27, 2024
1 parent c5e6cb5 commit 3e39380
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
14 changes: 14 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@ module "permission_sets" {
policy_attachments = ["arn:aws:iam::aws:policy/AdministratorAccess"]
customer_managed_policy_attachments = []
}]
groups = ["administrators", "developers", "networking"]

users = {
"Zach Rundle" = {
first_name = "Zach"
last_name = "Rundle"
groups = "administrators"
},
"Maverick Dog" = {
first_name = "Maverick"
last_name = "Dog"
groups = "developers"
},
}
}
6 changes: 0 additions & 6 deletions modules/iam_identity_center/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,12 @@ resource "aws_ssoadmin_customer_managed_policy_attachment" "this" {
}
}

# Fetching SSO Instance
data "aws_ssoadmin_instances" "this" {}

# Create SSO Groups
resource "aws_identitystore_group" "this" {
for_each = { for group_name in var.groups : group_name => group_name }
display_name = each.value
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
}

# Create SSO Users
resource "aws_identitystore_user" "this" {
for_each = var.users
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
Expand All @@ -92,7 +87,6 @@ resource "aws_identitystore_user" "this" {
}
}

# Assign Users to Groups
resource "aws_identitystore_group_membership" "this" {
for_each = var.users
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
Expand Down
17 changes: 0 additions & 17 deletions users.tf

This file was deleted.

0 comments on commit 3e39380

Please sign in to comment.