How to use count with data resources in Terraform
tl;dr version: " $ { e l e m e n t ( d a t a . g i t h u b _ t e a m . p u l l . * . i d , c o u n t . i n d e x ) } " While writing a little terraform module to manage github repositories, team permissions and branch protection rules, I ran into an issue where github_team_repository resources need the team ID, but github_branch_protection resources need the team slug. ...