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
The devops team uses different operating systems. When the configurations are planned/applied on machines with different O/Ss, Terraform detects lambda functions as changed, even if they aren't, due to differences in the compression libraries used.
Attempted Solutions
We've tried a few attempts, but none of them is conceptually sound or acceptably clean. The underlying workflow is assumed to be:
Terraform creates the deployment package (zip or jar)
Terraform computes a hash
AWS returns the hash of deployment package
Terraform compares them
currently, there is no way to work this around, because the file created at step 1. is bound to be different depending on the operating system library.
Proposal
Attempting to use off-the-shelf alternative archivers presents the same problems, as all the archivers have variable metadata (even tar).
The best (only) solution I can think of is to add a custom compression module that creates zip files which are exactly the same on each platform - this can be accomplished by using fixed metadata and no compression (the files are small anyway, so archive compression makes virtually no difference).
I'm not familiar with Golang compression libraries, however, the scope of the archiver logic is conceptually small/reduced - any complexity or odd edge cases, eg. symlinks, could be rejected, as they wouldn't be meaningful in a AWS Lambda context.
Additionally, this could be an alternate archival backend. Those who want full ZIP functionality, would use the standard backend.
The text was updated successfully, but these errors were encountered:
That's part of it, yes. There are multiple causes for a zip archive with the same data to be binary different (compression method, modification time, permissions).
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
Jul 25, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Terraform Version
Use-cases
The devops team uses different operating systems. When the configurations are planned/applied on machines with different O/Ss, Terraform detects lambda functions as changed, even if they aren't, due to differences in the compression libraries used.
Attempted Solutions
We've tried a few attempts, but none of them is conceptually sound or acceptably clean. The underlying workflow is assumed to be:
currently, there is no way to work this around, because the file created at step 1. is bound to be different depending on the operating system library.
Proposal
Attempting to use off-the-shelf alternative archivers presents the same problems, as all the archivers have variable metadata (even
tar
).The best (only) solution I can think of is to add a custom compression module that creates zip files which are exactly the same on each platform - this can be accomplished by using fixed metadata and no compression (the files are small anyway, so archive compression makes virtually no difference).
I'm not familiar with Golang compression libraries, however, the scope of the archiver logic is conceptually small/reduced - any complexity or odd edge cases, eg. symlinks, could be rejected, as they wouldn't be meaningful in a AWS Lambda context.
Additionally, this could be an alternate archival backend. Those who want full ZIP functionality, would use the standard backend.
The text was updated successfully, but these errors were encountered: