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
**Amodule #here this is used for creating kafka aws instances*
main.tf
kafkainstancevariables.tf
Bmodule #here this is used for creating alarms in those kafka instances
main.tf
cloudwatchalertsforkafkainstancesVariables.tf
Outside modules terraform mainfile from where all modules are called main.tf variables.tf***
How to access the variables created in Amodule in Bmodule?
Thank you!