Interview Prep/Terraform/Partial Applies, Version Mismatches and CI Failures

CI and laptops produce different plans for `archive_file` / `local_file` resources (hashes differ).

IntermediateTroubleshootingPartial Applies, Version Mismatches and CI Failures
Answer

Likely causes → Line endings (core.autocrlf on Windows), file permissions, or build artifacts present locally but not in CI change the archive content.

Diagnose → git ls-files --eol | grep crlf; compare the source dirs.

Fix → Add .gitattributes (* text=auto eol=lf), build artifacts in CI only, and exclude local junk with excludes in archive_file.

Prevent → Run applies only from CI so one environment builds artifacts.

All Terraform questions

More on Partial Applies, Version Mismatches and CI Failures