We have google api enablement all in one modules. there are tooooo many modules that depend on the same or overlapping apis. The real problem though is we had to hack a depencdency on this resource. We have an app/main.tf module that ideally, we could just say app/main.tf depends on app/apienablement/main.tf and call it a day. apienablment has enable gcp apis and sleep 60 seconds afterward. This works 100% as long as people depend on our output project_id but in many cases, this is left off and resources run before api enablement is complete. we keep adding this ‘fake dependency’ using project_id as output.
This KEEPS happening. If there was a way to just say hey, all modules in app/main.tf MUST RUN after all modules in app/apienablement, this would save us a ton of people breaking things.
What is worse is we do not find out until we spin up a new environment one month later and debugging which one is a massive nightmare. This is because existing environments have the api enabled. The ones we spin up and teardown however are intermittent so we don’t find these breaks until later and have to YET AGAIN add this damn project id fake dependency.
It seems like having STAGES like all modules in setup/main.tf run first and then app/main.tf run next would be amazing to alleviate this issue. As it currently stands, this is a major headache.