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

Fix for Error: Invalid for_each argument #13

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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,14 @@ Like this project? Please give it a ★ on [our GitHub](https://github.com/cloud
Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)



## Related Projects

Check out these related projects.

- [terraform-null-label](https://github.com/cloudposse/terraform-null-label) - Terraform module designed to generate consistent names and tags for resources. Use terraform-null-label to implement a strict naming convention.




## References

For additional context, refer to some of these links.
Expand Down
5 changes: 2 additions & 3 deletions modules/account-assignments/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ data "aws_identitystore_user" "this" {

locals {
assignment_map = {
for a in var.account_assignments : format("%v-%v", a.account, substr(base64sha256(
format("%v%v%v", a.principal_name, a.principal_type, a.permission_set_arn)
), 0, 15)) => a
for a in var.account_assignments :
format("%v-%v-%v-%v", a.account, substr(a.principal_type, 0, 1), a.principal_name, a.permission_set_name) => a
}
}

Expand Down
9 changes: 5 additions & 4 deletions modules/account-assignments/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
variable "account_assignments" {
type = list(object({
account = string
permission_set_arn = string
principal_name = string
principal_type = string
account = string
permission_set_name = string
permission_set_arn = string
principal_name = string
principal_type = string
}))
}