Skip to content

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

@richjyoung

Description

@richjyoung

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

  • provider registry.terraform.io/integrations/github v6.0.0-beta

Affected Resource(s)

  • github_team_members

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

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleUsed by stalebot to clean houseStatus: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions