You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
continual changes detected due to changing etag #796
Terraform v0.15.4
on linux_amd64
+ provider registry.terraform.io/integrations/github v4.9.4
Affected Resource(s)
github_repository
Expected Behavior
After a successful terraform apply, subsequent terraform plan or terraform apply should detect no changes and have nothing to do.
Actual Behavior
Every terraform plan or terraform apply after creating the resource shows:
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the last "terraform apply":
# github_repository.foo has been changed
~ resource "github_repository" "foo" {
~ etag = <some value> -> <some other value>
id = "foo"
name = "foo"
# (23 unchanged attributes hidden)
}
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply to create a GitHub repo
terraform apply again and see the above warning regarding changes to etag
Important Factoids
Because etag is not exposed on the github_repository resource, it's not possible to mark it to be ignored.
Reacted by Stan Domula, T.Goehlert, ZY, Mark Bainter, Ivan Drinchev, itkq, Sander Verhagen, Bret Martin, pmjacinto, Naomichi Yamakita and 104 more
I ran into the same problem after upgrading to Terraform 0.15.4. Deleting the repositories from the state with terraform state rm and then importing them with terraform import did not solve this issue. The ETag is still reported to be changed outside of Terraform.
Reacted by Sergei Shvetsov, Mark Bainter, Tom Harrison, Sharad Khadtare, Stan Domula and mado
I just encountered this after upgrading from 0.15.0 to 1.0.0. Interestingly, no changes were proposed even when Terraform detected a drift on the etag field:
$ terraform planAcquiring state lock. This may take a few moments......Note: Objects have changed outside of TerraformTerraform detected the following changes made outside of Terraform since the last "terraform apply": # github_repository.foo has been changed ~ resource "github_repository" "foo" { ~ etag = <some value> -> <some other value> id = "foo" name = "foo" # (23 unchanged attributes hidden) }Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo orrespond to these changes.──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────No changes. Your infrastructure matches the configuration.Your configuration already matches the changes detected above. If you'd like to update the Terraform state to match, create and apply a refresh-only plan: terraform apply -refresh-onlyReleasing state lock. This may take a few moments...
This behaviour seems consistent and expected as per the discussion on hashicorp/terraform#28803. As noted in the issue, using ignore_changes will not have an impact on this either.
I don't think there is much we can do at a provider-level to mitigate this, so I propose that we close this issue and track hashicorp/terraform#28803 in the upstream project.
Reacted by dags, Danny Sauer and Craig Samuelson
Reacted by Jeremy Udit, Stan Domula, Tom Harrison and Clayton Piccinin
Ignoring this issue is not a good solution for many.
I'm running drift detection and it shows up all the time taking unnecessary time to investigate on each run.
Reacted by StephenWithPH, sdpdeploy, DJ, dags, Vlad Dzhabarov, Davide de Paolis, Danny Sauer and Vlatko Boshkoski
They're not really ignoring the issue - they're just pointing out that ultimately the provider is working as expected, and terraform isn't honoring it as an expected change that should simply be updated in state quietly -- so ultimately it's on hashicorp to fix this. (Because they're not even accepting PRs from the community right now)
It's value is passed through to the HTTP If-None-Match header when reading API resources, so good to store across Terraform runs. 🤔 maybe we could add a DiffSuppressFunc to the etag field if there are no objections to making the etag internals less transparent.
Reacted by ZY, Ben Abrams, Krzysztof Szyper, Chris Kuchin, Alexander Bellhäuser and Robin Breathe
I think that the etag field is not particularly useful to end-users, so implementing DiffSuppressFunc should be a good approach to workaround this issue. Suppressing the etag field should not render changes to the other fields any less noticeable too.
Reacted by Ben Abrams, Jeremy Udit, StephenWithPH, Chris Kuchin, Alexander Bellhäuser, David Mikalova, DJ, Steve Brown, Bartlomiej Korupczynski, Doug Ayers and 1 more
Now, it seems to me that with #1780 the migration to the new SDK was done and released with version 6.
Some resources now export etag as an attribute one can use in ignore_changes, but most, like for example github_repository, still only include it as computed attribute, which cannot be used in ignore_changes.
What is stopping the use of private state for this (and possibly other) attribute(s)?
Reacted by oponomarov-tu, Usman, Joseph LaFreniere, eric, Dmytro Vdovychynskyi, Teodor Janez Podobnik, Morten M. Hansen and marcos ferreira
Based on the version of the SDK that we are currently using (terraform-plugin-sdk/v2 v2.34.0) we should be able to go with the initial approach (even on computed fields) of:
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return true
},
And add DiffSuppressOnRefresh: true as well to suppress the diff between config and state.
Lastly these fields have to be marked as Optional=true - SDK ref
Computed-only fields: Computed: true, Optional: false → Can't have DiffSuppressFunc
Optional computed fields: Computed: true, Optional: true → Can have DiffSuppressFunc
I believe we can set this to always returns true - which should suppress all etag diffs; this should also work for refresh operations as well.
This approach should be safe because ETags are internal concerns, not user configuration, ETags are still stored and used for API optimization by the SDK / provider, and all user changes to actual resource attributes are still detected normally.
Let me put a quick PR together to illustrate this and see if everyone agrees with the approach. The better move would be to migrate to the Plugin Framework but for now we can get this cleaned up a bit as is.
Here's what I was thinking: #2840 - I'll write up some tests to go with it but I think this approach is sound - please ✅ on the PR if you agree and I'll move to add this to the next release. ❤️
Reacted by Sýlvan Heuser, Alek Nowak and Vegard Hansen
Activity
sdomula commentedon May 21, 2021
I ran into the same problem after upgrading to Terraform 0.15.4. Deleting the repositories from the state with
terraform state rmand then importing them withterraform importdid not solve this issue. The ETag is still reported to be changed outside of Terraform.mbainter commentedon May 25, 2021
JIC - I also experience this problem on 0.15.4 and integrations/github v4.10
loozhengyuan commentedon Jun 9, 2021
I just encountered this after upgrading from
0.15.0to1.0.0. Interestingly, no changes were proposed even when Terraform detected a drift on theetagfield:This behaviour seems consistent and expected as per the discussion on hashicorp/terraform#28803. As noted in the issue, using
ignore_changeswill not have an impact on this either.I don't think there is much we can do at a provider-level to mitigate this, so I propose that we close this issue and track hashicorp/terraform#28803 in the upstream project.
jcudit commentedon Jun 15, 2021
Thanks for surfacing this information 🙇🏾
Pretty concerning from a performance perspective, so open to more ideas and can prioritize fixes accordingly.
ChristophShyper commentedon Sep 9, 2021
Ignoring this issue is not a good solution for many.
I'm running drift detection and it shows up all the time taking unnecessary time to investigate on each run.
mbainter commentedon Sep 9, 2021
They're not really ignoring the issue - they're just pointing out that ultimately the provider is working as expected, and terraform isn't honoring it as an expected change that should simply be updated in state quietly -- so ultimately it's on hashicorp to fix this. (Because they're not even accepting PRs from the community right now)
MOZGIII commentedon Sep 12, 2021
Why not just remove etag from the state? I mean, it is a possible solution at a provider level.
jcudit commentedon Sep 12, 2021
It's value is passed through to the HTTP
If-None-Matchheader when reading API resources, so good to store across Terraform runs. 🤔 maybe we could add aDiffSuppressFuncto theetagfield if there are no objections to making theetaginternals less transparent.loozhengyuan commentedon Sep 12, 2021
I think that the
etagfield is not particularly useful to end-users, so implementingDiffSuppressFuncshould be a good approach to workaround this issue. Suppressing theetagfield should not render changes to the other fields any less noticeable too.fix(r/repository): suppress `etag` changes
39 remaining items
irizzant commentedon Dec 23, 2024
I agree this is a very annoying issue, as there is no field for etag in the resource itself and cannot be ignored.
This is bad
syhe commentedon Jan 8, 2025
As per hashicorp/terraform-plugin-sdk#1355 (comment) , the culprit is ultimately the usage of the old SDK version without support for private state, as detailed in #1912 .
Now, it seems to me that with #1780 the migration to the new SDK was done and released with version 6.
Some resources now export
etagas an attribute one can use inignore_changes, but most, like for examplegithub_repository, still only include it as computed attribute, which cannot be used inignore_changes.What is stopping the use of private state for this (and possibly other) attribute(s)?
sl4m commentedon Jul 3, 2025
@syhe AFAICT, #1780 did not migrate over to the plugin Framework, but upgraded to v2 in the legacy SDK. #1912 is still open.
Update priority list: mark completed issues
nickfloyd commentedon Oct 29, 2025
Based on the version of the SDK that we are currently using (terraform-plugin-sdk/v2 v2.34.0) we should be able to go with the initial approach (even on computed fields) of:
And add
DiffSuppressOnRefresh: trueas well to suppress the diff between config and state.Lastly these fields have to be marked as
Optional=true- SDK refI believe we can set this to always returns
true- which should suppress all etag diffs; this should also work for refresh operations as well.This approach should be safe because ETags are internal concerns, not user configuration, ETags are still stored and used for API optimization by the SDK / provider, and all user changes to actual resource attributes are still detected normally.
Let me put a quick PR together to illustrate this and see if everyone agrees with the approach. The better move would be to migrate to the Plugin Framework but for now we can get this cleaned up a bit as is.
nickfloyd commentedon Oct 29, 2025
Here's what I was thinking: #2840 - I'll write up some tests to go with it but I think this approach is sound - please ✅ on the PR if you agree and I'll move to add this to the next release. ❤️