integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
888 stars 729 forks source link

[BUG]: Error: Invalid address to set: []string{"create_default_maintainer"} trying to import github_team_members #2124

Open richjyoung opened 7 months ago

richjyoung commented 7 months ago

Expected Behavior

Importing an existing team's members fails with an error. The team already exists and has been imported prior to this, with terraform plan showing no changes required. The existing team has members already added, and the github_team_members resource has been set up to match before import.

Actual Behavior

Running terraform import ... yields the following error:

> terraform import github_team_members.existing_team existing_team
github_team_members.existing_team: Importing from ID "existing_team"...
╷
│ Error: Invalid address to set: []string{"create_default_maintainer"}

Terraform Version

Terraform v1.7.1 on darwin_amd64

Affected Resource(s)

Terraform Configuration Files

resource "github_team" "existing_team" {
  name = "Existing Team"
  privacy = "closed"
  create_default_maintainer = false
}

resource "github_team_members" "existing_team" {
  team_id = github_team.existing_team.id

  members {
    username = "an-existing-user"
    role     = "maintainer"
  }
  members {
    username = "another-existing-user"
    role     = "member"
  }
}

Steps to Reproduce

  1. Manually create a Team or use an existing one
  2. Import the team into terraform
  3. Manually add users to the Team
  4. Attempt to import team members using:
$ terraform import github_team_members.existing_team existing_team

Debug Output

No response

Panic Output

No response

Code of Conduct