stacks: Make path.module and path.root relative, to match documentation
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
- [x] 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.
Sounds good, we should backport it and make it part of 1.14.3 👍
Does this PR fix https://github.com/hashicorp/terraform/issues/38005?
@crw No, to the best of my understanding it doesn't have anything to do with that request at all.