terraform: fileset does not respect gitignore

100 · Thiago Perrotta · Aug. 7, 2026, 9:53 a.m.
Summary
This blog post discusses a problem encountered while using Terraform with a NodeJS AWS Lambda project, where the `fileset()` function does not account for `.gitignore`, resulting in discrepancies between local and CI environments. The author describes the issue and presents a solution involving hashing build inputs instead of the entire build directory to ensure consistent and accurate triggers for Terraform plans. The post highlights the importance of understanding environment-dependent behavior in Terraform configurations.