Skip to content

Commit

Permalink
Use each.key when for_each is a set() (fix)
Browse files Browse the repository at this point in the history
each.value is only available for accessing a value in a map()
each.key must be used for a set()
  • Loading branch information
arledesma committed Jul 10, 2023
1 parent 9bcf073 commit 5cdd5b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/github-team/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resource "github_team" "team" {
resource "github_team_membership" "maintainer" {
for_each = var.maintainers
team_id = github_team.team.id
username = each.value
username = each.key
role = "maintainer"
}

Expand All @@ -40,6 +40,6 @@ resource "github_team_membership" "maintainer" {
resource "github_team_membership" "member" {
for_each = var.members
team_id = github_team.team.id
username = each.value
username = each.key
role = "member"
}

0 comments on commit 5cdd5b9

Please sign in to comment.