-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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 -from-module errors or crashes if that module references module's with local relative directories #25707
Comments
When trying to work around this by just not using -from-module, I encountered what looks like #21966 (backend initialization required issues) ... so my current workaround is to copy the source folder to a new directory (minus .terraform & any other artifacts from local testing) and then do a run from the directory with pristine source. It does mean that module { source = "../sistermodule" } doesn't work out of the box, but module { source = "./submodule") does at least. |
@rmt I have reproduced this issue on 0.12.29, but using 0.13.0 RC1 I cannot reproduce it, so I think this is fixed in the latest build. Can you try it with 0.13.0 RC1 (or GA, after Monday) and see if it's still a problem on your side? |
@rmt I haven't been able to reproduce this in 0.13.x, and I haven't heard back from you, so I'm going to go ahead and close this. If you're still seeing this problem in 0.13.x, please comment here or file a new issue and link this one. |
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. |
Terraform Version
Terraform Output (Error Scenario)
Terraform Output (Crash Scenario)
If you instead try to use a relative subdir, terraform will crash.
Expected Behavior
I would expect terraform to resolve the relative directories before the copy, resulting in a successful
terraform init
with the downloaded modules.Actual Behavior
Cryptic error message in the case of module foo { source = "../whatever" } and a crash in the case of module foo { source = "./whatever" }
Steps to Reproduce
As above.
Additional Context
I realize that you can avoid these errors by not using -from-module, so we do have a workaround.. We were using -from-module so that we have a chance to do some out-of-band TF templating between the terraform init & terraform apply commands, although we managed to strip most of this requirement thanks to 0.12.x.
References
The text was updated successfully, but these errors were encountered: