Repository navigation
Keep the generated config.json out of the frontend fileset - #4
Merged
Merged
Conversation
local_file.config_json writes frontend/config.json during the apply, and
aws_s3_object.frontend_files iterates fileset("../frontend", "**/*.*"),
which Terraform evaluates again during the apply. On a fresh checkout the
file appears between plan and apply and the deploy fails with "function
returned an inconsistent result". Match only the static asset types;
config.json is uploaded by aws_s3_object.config_json.
Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
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.
The push run on
mainfails at "Deploy the infrastructure" (run):local_file.config_jsonwritesfrontend/config.jsonduring the apply, whileaws_s3_object.frontend_filesiteratesfileset("../frontend", "**/*.*"), which Terraform evaluates again during the apply. On a fresh checkout the file appears between plan and apply, so the deploy fails. The PR run passed only because the S3 uploads happened to run first. Locally it fails every time on a fresh checkout. Filtering the result withsetsubtractis not enough: Terraform checks thefileset()call itself.The fileset now matches only static asset types (
html, css, js, png, jpg, jpeg, gif, svg, ico), interraform/andterraform-local/.config.jsonis already uploaded byaws_s3_object.config_json. Before, aconfig.jsonleft over from an earlier run was also uploaded under the same key, with stale URLs.Tested locally with
localstack/localstack-pro:latest(2026.10.0), following the CI job (OpenWeather stub): a freshmake deploycreates all 59 resources,make testpasses, and a second apply withconfig.jsonpresent also succeeds. Without this change the fresh deploy fails with the error above.