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

terraform init writes remote config to cwd even if target path provided #2927

Closed
apparentlymart opened this issue Aug 4, 2015 · 2 comments · Fixed by #4753
Closed

terraform init writes remote config to cwd even if target path provided #2927

apparentlymart opened this issue Aug 4, 2015 · 2 comments · Fixed by #4753
Assignees

Comments

@apparentlymart
Copy link
Contributor

the terraform init command has an optional second positional argument for the path where the module should be placed, defaulting to the current working directory.

When that argument is provided, the module config is copied into the given directory as expected, but the .terraform/terraform.tfstate file (created if you simultaneously configure remote state) is always written to the current working directory, and not to the target path.

This is bothersome since running terraform commands in the new directory then uses local state rather than remote state, which causes confusion at best and duplicated resources at worst.

@mitchellh
Copy link
Contributor

PR opened.

jen20 added a commit that referenced this issue Jan 20, 2016
command/init: put remote state config at proper path [GH-2927]
@ghost
Copy link

ghost commented Apr 28, 2020

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 have 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.

@ghost ghost locked and limited conversation to collaborators Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants