Ask Your Question
2

What is the process of initializing terraform in a particular folder and referencing configuration scripts located in another folder?

asked 2023-03-15 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-06-14 18:00:00 +0000

woof gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-03-15 11:00:00 +0000

Seen: 15 times

Last updated: Jun 14 '22