Using one module local variable in another module in terraform
<p>I am trying to access one module variable in another new module to get aws instance ids which are created in that module and use them in a module Cloud watch alerts which creates alarm in those instance ids . The structure is something like the below</p>

<pre><code>**Amodule #here this is used for creating kafka aws instances*

     main.tf
     kafkainstancevariables.tf
</code></pre>

<p>Bmodule #here this is used for creating alarms in those kafka instances</p>

<pre><code>     main.tf
     cloudwatchalertsforkafkainstancesVariables.tf
</code></pre>

<p>Outside modules terraform mainfile from where all modules are called
        main.tf
        variables.tf***</p>

<p>How to access the variables created in Amodule in Bmodule?</p>

<p>Thank you!</p>