Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TF_HOME_DIR env variable support as alternative to ~/.terraform.d #31952

Closed
wants to merge 3 commits into from
Closed

Conversation

tony-sol
Copy link

@tony-sol tony-sol commented Oct 5, 2022

Add supporting for TF_HOME_DIR environment variable for unix, which allows to move terraform.d dir from $HOME.

If TF_HOME_DIR is empty or not set, fallback to default behavior with ~/.terraform.d

Fixes #15389

Target Release

1.4.x

Draft CHANGELOG entry

NEW FEATURES

  • You can now specify alternative to ~/.terraform.d config directory location with TF_HOME_DIR. Default config file affected as well - with TF_HOME_DIR it will be placed in "${TF_HOME_DIR}/terraformrc" if not overwritten by TF_CLI_CONFIG_FILE or TERRAFORM_CONFIG

@hashicorp-cla
Copy link

hashicorp-cla commented Oct 5, 2022

CLA assistant check
All committers have signed the CLA.

@tony-sol tony-sol marked this pull request as ready for review October 6, 2022 12:07
@crw crw added the enhancement label Oct 6, 2022
@crw
Copy link
Collaborator

crw commented Nov 23, 2022

Thanks for your submission! The feedback on this PR from the maintainers is that we would rather not invent a new Terraform-specific environment variable when there's already a standard on each of the primary platforms we target. Thus we would be more interested in supporting the XDG specification (and its equivalents on macOS and Windows).

The hope was to address this with other (possibly breaking) changes to CLI configuration, e.g. HCL 2 support for CLI config, however that does not seem likely in the near future. I will keep this PR open for now pending further discussion of the solution. Thanks again for this submission! We appreciate your contribution.

@tony-sol
Copy link
Author

tony-sol commented Mar 1, 2023

Closed due to make a more complex solution

@tony-sol tony-sol closed this Mar 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use xdg basedir spec on linux
3 participants