-
Notifications
You must be signed in to change notification settings - Fork 117
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
random string regenerates each time when override_special is defined #64
Comments
It gets more interesting. I tried to fix it by setting: lifecycle {
ignore_changes = ["override_special"]
} It actually does ignore the changes, but still changes the output. I suspect it has something to do with special characters.
The first time it has First run: "result": "\ufffd\u0002\ufffdO\ufffds\u0008\u0003x\ufffd\ufffd:\ufffd$\ufffds", Second run: "result": "�\u0002�O�s\u0008\u0003x��:�$�s", I think it is doing some strange unicode encoding. I am not sure how to get around this. All of this because of #63 |
Hi @deitch, Terraform strings are of unicode characters rather than bytes, so what you are trying to do here is not possible with Terraform strings. It would require some specialized handling of random bytes as you described in #63. The weird behavior you saw with diffing is a result of the fact that 0.11 did not consistently validate input as UTF-8 and would e.g. allow hex character escapes to produce invalid UTF-8 which Terraform's internals would then corrupt by assuming valid UTF-8. In Terraform 0.12 I expect you'd see a different result... probably interpreting your I think there is still a bug to be fixed in Until that bug is fixed, only ASCII characters are usable in |
Thanks for the explanation @apparentlymart. In the meantime I generated |
When I override the special characters to include the entire set of ascii chars (i.e. 0x00-0xff), it regenerates every single time.
Terraform Version
Affected Resource(s)
random_string
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
The relevant part is here:
it says that
override_special
is forcing a new resource.Expected Behavior
What should have happened?
The input is unchanged, so the resource should be unchanged
Actual Behavior
What actually happened?
New resource
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
main.tf
in a dir with the above contenttf init .
tf apply .
Then run it again
The text was updated successfully, but these errors were encountered: