So I have file called main.tf in which I am calling the existing module for iam_role, but in same main.tf I have called one more module for service_role but I want to restrict that service_role module to only run for my monitoring.tf file not any other tf file. Is there possible way to do that? Adding two modules in same main.tf and restrict for only one .tf file?
-
1You'd better show your terraform script first, it's heavily difficult to understand what do you want to achieve. Modules are made to be reused, you called anywhere where you want them to call and that's it. Not sure what do you want to restrict in here.– holmsOct 3, 2021 at 1:16
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.– Community BotOct 4, 2021 at 16:11