You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I have a project with three modules, a, b, and c.
a is a module that does nothing.
$ mkdir a b c
$ cd a
$ touch a.tf
$ terraform planRefreshing Terraform state prior to plan...No changes. Infrastructure is up-to-date. This means that Terraformcould not detect any differences between your configuration andthe real physical resources that exist. As a result, Terraformdoesn't need to do anything.
So far, so good. Now, b uses a:
$ cd ../b
$ cat > b.tfmodule "a" { source = "../a"}
$ terraform getGet: file:///terraform-test/a
$ terraform planRefreshing Terraform state prior to plan...No changes. Infrastructure is up-to-date. This means that Terraformcould not detect any differences between your configuration andthe real physical resources that exist. As a result, Terraformdoesn't need to do anything.
Awesome carrots. Now c uses b:
$ cd ../c
$ cat > c.tfmodule "b" { source = "../b"}
$ terraform getGet: file:///terraform-test/bGet: file:///terraform-test/c/.terraform/modules/aError loading Terraform: Error downloading modules: error downloading module 'file:///terraform-test/c/.terraform/modules/a': source path error: stat /terraform-test/c/.terraform/modules/a: no such file or directory
💥 💥 💥
Using ${path.module} just makes things even more confusing.
$ cd ../b
$ cat > b.tfmodule "a" { source = "${path.module}/../a"}
$ terraform getGet: file:///terraform-test/b/aError loading Terraform: Error downloading modules: error downloading module 'file:///terraform-test/b/a': source path error: stat /terraform-test/b/a: no such file or directory
Did you not see the .. in the path? What if I omit it?
$ cat > b.tf module "a" { source = "${path.module}/a"}
$ terraform getGet: file:///terraform-test/b/${path.module}/aError loading Terraform: Error downloading modules: error downloading module 'file:///terraform-test/b/${path.module}/a': source path error: stat /terraform-test/b/${path.module}/a: no such file or directory
Now the variable just isn't expanded at all? 😕 If no .. is worse, how about more ..?
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
locked and limited conversation to collaborators
May 3, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Say I have a project with three modules,
a
,b
, andc
.a
is a module that does nothing.So far, so good. Now,
b
usesa
:Awesome carrots. Now
c
usesb
:💥 💥 💥
Using
${path.module}
just makes things even more confusing.Did you not see the
..
in the path? What if I omit it?Now the variable just isn't expanded at all? 😕 If no
..
is worse, how about more..
?I have no logical explanation for why this works. Does it solve my problem?
Apparently not. 😞
The text was updated successfully, but these errors were encountered: