Repository navigation
Closed
Labels
Type: BugSomething isn't working as documented
Description
Expected Behavior
terraform plan on code containing github_team_repository shouldn't contain changes to etags. This seems related to #2840 but github_team_repository was missed
Actual Behavior
terraform plan on code containing github_team_repository includes changes to etags
Terraform Version
terraform -v
Terraform v1.14.4
on darwin_arm64
- provider registry.terraform.io/hashicorp/google v7.24.0
- provider registry.terraform.io/integrations/github v6.11.1
Affected Resource(s)
- github_team_repository
- github_repository_deploy_key
Terraform Configuration Files
resource "github_repository" "terraform-test" {
name = "terraform-test"
visibility = "private"
allow_forking = false
template {
owner = "<redacted>"
repository = "<redacted>"
}
lifecycle {
ignore_changes = [pages]
}
}
resource "github_team_repository" "repo_maintainers" {
team_id = "cloudteam"
repository = github_repository.terraform-test.name
permission = "Maintain Plus"
}Steps to Reproduce
Change any of the parameters to github_team_repository in the example above -
git diff
diff --git a/terraform-debug/main.tf b/terraform-debug/main.tf
index 7dc5c12..238d9b0 100644
--- a/terraform-debug/main.tf
+++ b/terraform-debug/main.tf
@@ -15,7 +15,7 @@ resource "github_repository" "terraform-test" {
}
resource "github_team_repository" "repo_maintainers" {
- team_id = "infosec"
+ team_id = "cloudteam"
repository = github_repository.terraform-test.name
permission = "Maintain Plus"
}
$ terraform plan
data.google_secret_manager_secret_version.github-org-app: Reading...
data.google_secret_manager_secret_version.github-org-app: Read complete after 1s [id=projects/164402708602/secrets/kivra-terraform-repo-creator-pem/versions/2]
github_repository.terraform-test: Refreshing state... [id=terraform-test]
github_team_repository.repo_maintainers: Refreshing state... [id=3621971:terraform-test]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# github_team_repository.repo_maintainers must be replaced
-/+ resource "github_team_repository" "repo_maintainers" {
~ etag = "W/\"7a92613025eafbcc387d2e29c757cefd560cfa02f5a75bdf6a8d18669c84fa04\"" -> (known after apply)
~ id = "3621971:terraform-test" -> (known after apply)
~ permission = "admin" -> "Maintain Plus"
~ team_id = "infrasec" -> "cloudteam" # forces replacement
# (1 unchanged attribute hidden)
}
Plan: 1 to add, 0 to change, 1 to destroy.
Debug Output
Panic Output
Code of Conduct
- I agree to follow this project's Code of Conduct
Reacted by Andrew Grigorev
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't working as documented
Activity
github-actions commentedon Mar 19, 2026
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with
Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀deiga commentedon Mar 19, 2026
@caulagi Thanks for raising this!
I think you can use
lifecycle.ignore_changesfor now to get it out of your plan, until it's fixed.@stevehipwell @robert-crandall
While addressing this is fairly simple, I wonder if we should make a decision for removing the
etagfields and doingetaghandling on a lower levelcaulagi commentedon Mar 23, 2026
Thanks! its the same behaviour for
github_repository_deploy_key. Should I create a separate issue for this or will this be handled as part of the refactoring you are suggesting @deiga ?caulagi commentedon Mar 23, 2026
Forgot to mention that
ignore_changesdoesn't work for this bug and I get this warning instead -deiga commentedon Mar 23, 2026
Oh 🤦♂️
Thanks for sharing that!
I think we could rename this issue to something like "address etag drift in all resources" to cover both mentioned resources.
[-][BUG]: github_team_repository doesn't ignore etags[/-][+][BUG]: address etag drift in resources[/+]fix: Add DiffSuppressFunc and DiffSuppressOnRefresh to remaining etag…