Repository navigation
fix(terraform): rebuild every Lambda that bundles lambda/shared - #604
Merged
Merged
Conversation
Nine esbuild-bundled Lambdas lacked hash_extra = local.shared_sources_hash: sprints, tasks, questions, sprint-graph, timeline-events, migrate-tracker-fields, building-blocks, seed-blocks and ws-connection. A change only under lambda/shared/ left their package name unchanged, so the plan kept the deployed source_code_hash and the apply failed with "Provider produced inconsistent final plan" once the rebuilt zip differed. Add the hash to those modules, and the same local to the realtime module.
Contributor
|
@thenom is there any reason all of the PRs you created are in draft? Just checking if I should start reviewing already. Thanks for contributing to this project! |
Contributor
Author
|
Hey @JWThewes, yeh thanks, i am just getting a couple of additional internal reviews before removing the draft markers. Its just a load of patches we were applying locally but it ran away with us so just trying to submit them all back 😄 If your happy with any of them, by all means let me know and i will remove the marker 👍 |
thenom
marked this pull request as ready for review
October 23, 2026 10:45
thenom
requested review from
JWThewes,
eipasteur,
jeromevdl,
leandrodamascena and
svozza
as code owners
October 23, 2026 10:45
JWThewes
approved these changes
Oct 26, 2026
JWThewes
left a comment
Contributor
There was a problem hiding this comment.
Thanks for contributing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: None
Description of changes:
Problem
The Lambda module names each package after a hash of the Lambda's own
source_path. Most esbuild-bundled Lambdas also sethash_extra = local.shared_sources_hash, so a change underlambda/shared/rebuilds them. Nine don't:modules/api/lambda/main.tf: sprints, tasks, questions, sprint-graph, timeline-events, migrate-tracker-fields, building-blocks and seed-blocksmodules/realtime/lambda.tf: ws-connectionWhen a change touches only
lambda/shared/, their package filename stays the same, so the plan keeps the deployedsource_code_hash. The apply then fails withProvider produced inconsistent final planonce the rebuilt zip turns out to differ.Solution
hash_extra = local.shared_sources_hashto those nine modules.shared_sources_hashlocal to the realtime module, mirroringmodules/api/lambda.Testing
terraform fmt -check,terraform validate -no-testsand everyterraform testsuite from the Terraform workflow pass on Terraform 1.15.0, includinglambda-packaging.tftest.hcl(7 passed). The SSO plan-privacy test also passes.Impact
The first apply after merging rebuilds and redeploys those nine Lambdas once, because their package names change. After that, they redeploy only when their own code or
lambda/shared/changes.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.