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
In Terraform 0.12, the file() function only allows UTF-8 content to provide safety against state corruption. Prior to the introduction of the new file hashing functions in #20098, the filebase64() function was the only file conversion/hashing function available and the error messaging was coded to recommend it, however the recommendation can be incorrect in the following situations:
config is invalid: Error in function call: Call to function "file" failed: contents of example.zip are not valid UTF-8; to read arbitrary bytes, use the filebase64 function instead.
config is invalid: Error in function call: Call to function "file" failed: contents of example.tar.gz are not valid UTF-8; to read arbitrary bytes, use the filebase64 function instead.
The correct configuration updates here are the filebase64sha256() and filemd5() functions respectively.
Proposal
It would be preferable to remove the explicit filebase64() function recommendation unless we know for certain it is the correct recommendation.
I had a feeling this would come up. It is unfortunate, indeed.
I think the compromise I'd like to try here is to reword the message to be clearer about what we have changed: binary data can no longer be used, if a base64-encoded result is suitable then use filebase64 instead, but note that the result will not be the same and so the value will need to be used in a different way.
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.
ghost
locked and limited conversation to collaborators
Aug 13, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Terraform Version
Description
In Terraform 0.12, the
file()
function only allows UTF-8 content to provide safety against state corruption. Prior to the introduction of the new file hashing functions in #20098, thefilebase64()
function was the only file conversion/hashing function available and the error messaging was coded to recommend it, however the recommendation can be incorrect in the following situations:The correct configuration updates here are the
filebase64sha256()
andfilemd5()
functions respectively.Proposal
It would be preferable to remove the explicit
filebase64()
function recommendation unless we know for certain it is the correct recommendation.References
The text was updated successfully, but these errors were encountered: