boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
674 stars 46 forks source link

Use Terraspace.tmp_root value instead of hard-coded '/tmp/terraspace' #339

Closed nevdullcode closed 9 months ago

nevdullcode commented 9 months ago

This is a 🐞 bug fix.

Summary

Use Terraspace.tmp_root value instead of hard-coded '/tmp/terraspace'.

Context

This resolves the problems I reported here: https://github.com/boltops-tools/terraspace/issues/123#issuecomment-1844317930

Terraspace.tmp_root was not being used consistently throughout the terraspace library source.

Which are sub-problems of existing reported issue: #123

How to Test

To test, simply run:

export TS_TMP_ROOT=$HOME/test-foo/ts-tmp

Then, run terraspace up <stack> and you should notice all relevant files will be written under the directory specified by the TS_TMP_ROOT environment variable.

Previously, some files would have been written under the directory defined by TS_TMP_ROOT and some would have been written under '/tmp/terraspace' which was not expected, consistent behavior.