Module Dependency Graph

Follow this order to apply Terraform safely and avoid dependency issues.

Each module references outputs from upstream modules. The diagram below shows the dependency order - modules must be deployed top-to-bottom. Deploying out of order will result in missing references or Terraform errors.

Note

module.logscale-storage-account depends on module.azure-kubernetes because the storage module references k8s_cluster_principal_id to grant the AKS managed identity read access to the primary storage account during DR standby. When both modules are included in the same targeted apply (-target), Terraform resolves this dependency automatically and creates azure-kubernetes first.

text
module.azure-core (infra)
  โ””โ”€> module.azure-keyvault (infra)
        โ”œโ”€> module.azure-kubernetes (infra)
        โ”‚     โ”œโ”€> module.logscale-storage-account (storage)
        โ”‚     โ””โ”€> module.pre-install (prep)
        โ”‚               โ””โ”€> module.logscale.module.crds (app)
        โ”‚                         โ””โ”€> module.logscale (app)
        โ”‚                                   โ”œโ”€> module.traffic-manager [primary only, if manage_traffic_manager=true] (dr)
        โ”‚                                   โ””โ”€> module.dr-failover-function [secondary only, if dr_failover_function_enabled=true] (dr)
        โ””โ”€> module.logscale-storage-account (storage)
              โ””โ”€> module.pre-install (prep)