Can someone dumb down and explain double slashes to me?

Hello all,

I don’t quite get what double slashes really mean as explained in the Terraform docs and how it relates to my terragrunt/terraform code. Here is how it is defined on the Terraform website:
A special double-slash syntax is interpreted by Terraform to indicate that the remaining path after that point is a sub-directory within the package. For example:
git::https://example.com/network.git//modules/vpc

How does this relate when it comes to calling on my modules in my Terragrunt code? I am calling on a Modules folder where I keep all my modules locally

Terraform Code

  • Prod clients
    In prod client folder 3 subfolders client_id -> team_name -> Dev
  • Modules

In that Dev folder I have my terraform code and my terragrunt.hcl with a Source block of:

terraform {
  source = "../../../../Modules/"
  }

Is this correct? Do I need the double slashes?

I don’t quite follow the directory layout you described. In the future, you might find it easiest to use the tree command to print the directory structure in a more human readable format.

That said, the double slashes don’t apply to local filesystem paths. From the docs [emphasis added]:

When the source of a module is a version control repository or archive file (generically, a “package”), the module itself may be in a sub-directory relative to the root of the package.

In the case of a local path, you can just supply the path to the module you want to use with no // syntax. Note that it would need to be a specific module. E.g.

terraform {
    source = "../../../../Modules/SomeModule"
}