What steps should be followed for making an object of one module to be available for the other module at a high level?

devquora
devquora

Posted On: Nov 17, 2022

 

Following are the steps which should be followed for making an object of one module to be available for the other module at a high level: First, an output variable to be defined in a resource configuration. Till you do not declare resource configuration details, the scope of local and to a module. Now, you have to declare the output variable of module_A to be used in another module's configuration. A brand new and latest key name should be created by you and the value should be kept equivalent to the module_A’s output variable.

Now, for module_B you have to create a file variable.tf. Establish an input variable inside this file having exactly the same name as was in the key defined by you in module_B. In a module, this particular variable enables the resource's dynamic configuration. For making this variable available to some other module also, replicate the process. This is because the particular variable established here has its scope restricted to module_B.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Terraform Interview Questions

    What is Terraform?

    Terraform is a tool of the DevOps toolchain which is used for development and change in the infrastructure with safety. It is an efficient tool for the versioning of the infrastructure. This tool has ...

    Terraform Interview Questions

    Why should Terraform be preferred for DevOps?

    There are a bunch of reasons for giving preference to Terraform to be used as one of the significant tools of DevOps. The main motive of DevOps is to bring efficiency and quality in software delivery....

    Terraform Interview Questions

    What are the features of Terraform?

    Main key features of Terraform include :Graphing - Its features of graphing that are built-in are helpful in visualizing the infrastructure. Custom Syntax - It's custom syntax is very friendly wh...