terraform-cdk
terraform-cdk copied to clipboard
.cdktf/ is created in $HOME without any ability to override it
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
My $HOME is not writable, so that whenever a tool tries to add something there, I know about it, and either drop the tool or create the directory myself, with a mask that I control. This has always me to keep my $HOME tidy.
I tried using cdktf for the first time today, and got the following error
Error: EACCES: permission denied, mkdir '/home/SCRUBBED/.cdktf'
at Object.mkdirSync (node:fs:1349:3)
at Object.Gz (/home/lestephane/GitRepos/cdktf-playground/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:7:7129)
at GRe (/home/lestephane/GitRepos/cdktf-playground/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:392:3323)
at Xzt (/home/lestephane/GitRepos/cdktf-playground/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:392:3594)
It is customary to make those locations overridable using environment variables (example: $TF_PLUGIN_CACHE_DIR).
References
Hi @lestephane! Thank you for raising this.
We do offer an CDKTF_HOME
environment variable, however there was one instance where it wasn't used. I created https://github.com/hashicorp/terraform-cdk/pull/1778 to fix that.
Closed via #1778
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.