hashicorp / learn-terraform-github-user-teams Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://learn.hashicorp.com/tutorials/terraform/github-user-teams
License: Mozilla Public License 2.0
Home Page: https://learn.hashicorp.com/tutorials/terraform/github-user-teams
License: Mozilla Public License 2.0
I get these two error messages:
Error: This resource can only be used in the context of an organization, "" is a user.
│
│ with github_team.all["Developer Team"],
│ on teams.tf line 4, in resource "github_team" "all":
│ 4: resource "github_team" "all" {
│
╵
╷
│ Error: This resource can only be used in the context of an organization, "" is a user.
│
│ with github_team.all["Security Team"],
│ on teams.tf line 4, in resource "github_team" "all":
│ 4: resource "github_team" "all" {
│
╵
What does it mean and how can I fix it?
Is it possible to use a nested loop to iterate through each file in repos-team
and set the team and respective permission for the repo ... instead of defining a configuration block for each repo as it is in ./repositories.tf
?
# Add memberships for application repository
resource "github_team_repository" "application" {
for_each = {
for team in local.repo_teams_files["application"] :
team.team_name => {
team_id = github_team.all[team.team_name].id
permission = team.permission
} if lookup(github_team.all, team.team_name, false) != false
}
team_id = each.value.team_id
repository = github_repository.application.id
permission = each.value.permission
}
When trying to add a new team to the org by adding it to the CSV file I am getting the following error:
│ Error: Invalid for_each argument
│
│ on teams.tf line 15, in resource "github_team_membership" "members":
│ 15: for_each = { for tm in local.team_members : tm.name => tm }
│ ├────────────────
│ │ local.team_members will be known only after apply
│
│ The "for_each" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply only the
│ resources that the for_each depends on.
I get the error with or without the respective team csv file existing in the team-members folder.
If I add the team via the gui first and then import the team I'm able to get the plan and apply to work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.