-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding instance group to existing region_backend_service creates permadiff #1696
Comments
For what it's worth, this is an excerpt from the debug logs when this issue happens:
The I was able to work around this by using the |
I've been looking into this, and don't have a complete answer just yet--it appears that the underlying Terraform framework is not behaving as it should, but I can't say that with much certainty yet--but I have discovered a workaround: if the backends inside the backend_service have a description, this bug doesn't seem to trigger. It's not perfect, but it may be a better solution than shelling out to another tool. I'll keep working on this. [UPDATE] It appears even setting the description to an empty string (instead of just omitting it) in the config fixes the issue. I have a hunch this is related to the |
thanks for digging into this @paddycarver! we'll use the description workaround for now. |
@paddycarver one update, it looks like you have to use empty string for the description, otherwise we see a different permadiff state of continually trying to add the description to those backends. |
@mlauter do you happen to have a log for that happening? In my tests, setting the backend descriptions to "test 1" and "test 2" resolves the issue :/ I've definitely narrowed this down to how the sub block interacts with self_links, because we need it to accept self_links for both beta and v1 versions of the API. Eventually, I think we have a plan for that to go away, but I'd rather not have this weird bug lingering around until then. Unfortunately, all my attempts to resolve it have been stymied so far. I think it may require a fix in core, and given that 0.12 is on the horizon, which will change some diffing behaviour, I'm loathe to spend a bunch of time diving into the diffing behaviour trying to figure out how to get a permanent solution here. How inconvenient is the empty string |
I believe this is an occurrence of hashicorp/terraform#19658, which is fixed in Terraform |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Terraform Version
Terraform v0.11.7
Affected Resource(s)
Terraform Configuration Files
webserver module outputs
main
Expected Behavior
-green
instance_group will be added towebserver
region backend service,-blue
instance_group will remain as a backend for thewebserver
backend service.Actual Behavior
-green
instance_group is added as a backend to the region backend service, and-blue
instance_group is removed.Furthermore, if I run
terraform apply
again without making any changes to the config, the reverse will happen --green
will be removed and-blue
will be added back. This appears to be a permanent diff state.Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: