Terraform Version
v0.12.24
Provider Version
v2.8.0
Affected Resource(s)
- github_repository_collaborator
Terraform Configuration Files
data "github_membership" "test-user" {
username = "testuser"
}
resource "github_repository" "my-repo" {
name = "my-repo"
private = true
description = ""
}
resource "github_repository_collaborator" "my-repo-test-user" {
repository = github_repository.my-repo.name
username = data.github_membership.test-user.username
permission = "maintain"
}
terraform import github_repository_collaborator.my-repo-test-user my-repo:testuser
Expected Behavior
After importing an existing collaborator with Maintain permissions the collaborator should have maintain permissions in the state.
Actual Behavior
After importing an existing collaborator with Maintain permissions the collaborator gets push permissions in the state. Running terraform plan afterwards notes a replacement.
# github_repository_collaborator.my-repo-test-user must be replaced
-/+ resource "github_repository_collaborator" "my-repo-test-user" {
~ id = "my-repo:testuser" -> (known after apply)
+ invitation_id = (known after apply)
~ permission = "push" -> "maintain" # forces replacement
repository = "my-repo"
username = "testuser"
}
Running terraform apply in the end leads to
Error: User testuser is already a collaborator
Overall, the error is similar to #469, but the actual problem seems to be the import to the state in this situation.
Steps to Reproduce
terraform import github_repository_collaborator.my-repo-test-user my-repo:testuser
terraform plan
terraform apply
Terraform Version
v0.12.24
Provider Version
v2.8.0
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
After importing an existing collaborator with Maintain permissions the collaborator should have
maintainpermissions in the state.Actual Behavior
After importing an existing collaborator with Maintain permissions the collaborator gets
pushpermissions in the state. Runningterraform planafterwards notes a replacement.Running
terraform applyin the end leads toOverall, the error is similar to #469, but the actual problem seems to be the import to the state in this situation.
Steps to Reproduce
terraform import github_repository_collaborator.my-repo-test-user my-repo:testuserterraform planterraform apply