Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To initialize Terraform in a particular folder and reference configuration scripts located in another folder, follow these steps:

  1. Open a terminal or command prompt in the folder you want to initialize Terraform in.

  2. Navigate to the folder that contains the configuration scripts you want to reference.

  3. Copy the configuration scripts to the folder you initialized Terraform in.

  4. Open a terminal or command prompt in the initialized Terraform folder.

  5. Run the command terraform init to initialize Terraform in the folder.

  6. In the main configuration file, specify the location of the configuration files using the source parameter in the module block.

Example:

module "example" {
  source = "../path/to/configuration/files"
  ...
}

This will tell Terraform to look for the configuration files in the specified location.