Skip to content

Conversation

@nfagerlund
Copy link
Member

@nfagerlund nfagerlund commented Dec 9, 2025

Previously, we were just handing off the absolute path produced by the sourcebundle struct. But that's no good, because the value doesn't stay consistent between plan and apply when running under tfc-agent. (It uses working directories named after the unique job ID.) It also doesn't match the documentation, which describes these as relative paths. This was preventing people from uploading module-provided files to create aws lambda functions, for example.

This commit addresses that by converting the source-bundle provided module path to a relative path (relative to Terraform's working directory). In tfc-agent for stacks runs, that ends up being the directory directly above the sourcebundle directory, and all the paths below that are consistent between plan and apply.

Fixes: jira IPL-8856

Target Release

Would it be okay to backport this? It's affecting customers in the wild, and there are a few other PRs in flight (@DanielMSchmidt 's) that seem patch-worthy.

1.14.2

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

No.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
    • but lemme know if I didn't do it right. It's in the 1.14 dir because I'm hoping for a backport.
  • This change is not user-facing.

Previously, we were just handing off the absolute path produced by the
sourcebundle struct. But that's no good, because the value doesn't stay
consistent between plan and apply when running under tfc-agent. (It uses working
directories named after the unique job ID.) It also doesn't match the
documentation, which describes these as relative paths. This was preventing
people from uploading module-provided files to create aws lambda functions, for
example.

This commit addresses that by converting the source-bundle provided module path
to a relative path (relative to Terraform's working directory). In tfc-agent for
stacks runs, that ends up being the directory directly above the sourcebundle
directory, and all the paths below that are consistent between plan and apply.
@nfagerlund nfagerlund added the 1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Dec 9, 2025
@nfagerlund nfagerlund requested a review from a team as a code owner December 9, 2025 23:11
@DanielMSchmidt
Copy link
Contributor

Sounds good, we should backport it and make it part of 1.14.3 👍

@nfagerlund nfagerlund merged commit b2aad91 into main Dec 12, 2025
9 checks passed
@nfagerlund nfagerlund deleted the nf/dec25-path-dot-module branch December 12, 2025 19:05
@crw
Copy link
Contributor

crw commented Dec 15, 2025

Does this PR fix #38005?

@nfagerlund
Copy link
Member Author

@crw No, to the best of my understanding it doesn't have anything to do with that request at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants