-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Whitespace changes in heredoc force new resources #4435
Comments
Hi @yissachar - thanks for opening this issue - I can certainly see the concern here. One option here is to normalise the line endings to the correct |
It seems reasonable to me that for the purposes of hashing and diff calculation that we'd normalize line endings, but for content we'd respect the line endings we see. It would be sort of a big change though, since updating the logic would have the potential to trigger unwanted diffs across all resources for existing users. We'd probably need to write state migration code to prevent this from happening. I wonder if this is something we could address more directly at the resource level by doing state normalization on this field. @yissachar is |
I'm also seeing it on |
I am seeing a similar issue in I don't know if it is the same issue or not. I have a HEREDOC setup and every time I apply, it wants to update this field. It looks like the state is being stored with all whitespace removed, but the diff is being done against the original version with whitespace. |
+1 |
Moving this to an AWS issue, we now have the technology to fix this:
|
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I have the following ECS task:
If I then add an extra space after one of the commas, this will force a new version of the task as Terraform thinks that it has changed.
For my particular situation this causes problems since we have developers on Mac and Windows. Since we have Git set to convert line-endings, this means the local file on Windows uses
\r\n
for line-endings, and Mac uses\n
. Terraform sees that thecontainer_definitions
has some changes and forces an update of all the resources involved.I understand that it might be out of scope for Terraform to handle something like this, but it would be nice if there were some way of dealing with the issue. For now we are forced to restrict Terraform
plan
andapply
usage to one OS.The text was updated successfully, but these errors were encountered: