Skip to content

Instantly share code, notes, and snippets.

@dgmorales
Created February 2, 2019 21:31
Show Gist options
  • Save dgmorales/5c7abe273c90a740d6c0ce2f6d6750b8 to your computer and use it in GitHub Desktop.
Save dgmorales/5c7abe273c90a740d6c0ce2f6d6750b8 to your computer and use it in GitHub Desktop.
Terraform example showing list, count and function usage on resources
locals {
org_user_list = [
"someguy",
"someotherguy",
"dgmorales"
]
}
resource "github_membership" "dgmorales" {
count = "${length(local.org_user_list)}"
username = "${element(local.org_user_list, count.index)}"
role = "member"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment