unfunco / terraform-aws-oidc-github

Terraform module to configure GitHub Actions as an IAM OIDC identity provider in AWS.
https://registry.terraform.io/modules/unfunco/oidc-github/aws/latest
Apache License 2.0
91 stars 51 forks source link

Prevent duplicate client_ids records #16

Closed zbmowrey closed 1 year ago

zbmowrey commented 1 year ago

If a user adds a number of repository references from the same Org, the module would add a new client_id record for the org for each repository reference. This resolves that concern by ensuring that the client_ids list always consists of distinct records.

kirintwn commented 1 year ago

+1, or we can convert the variable local.github_organizations to set:

github_organizations = toset([for repo in var.github_repositories : split("/", repo)[0]])
unfunco commented 1 year ago

Thanks @zbmowrey, I think @kirintwn's option would be the cleaner solution. Feel free to update the PR or I'll get to it in the week some time, I'm going to tag 1.0.0 after a little cleanup so this fix will be released along with that version.

zbmowrey commented 1 year ago

Done