title: terraform module depends_on Azure
body: <p>I am building a production infrastructure in Azure cloud with terraform. My requirements are below.</p>
  
  <p>Azure key vault should be provision first, as I will utilize a secret from there. But as terraform module doesn't support depend_on. Any workaround will be highly appricaiable.</p>
  
  <pre><code>     source    = "./../modules/azurekeyvault/"
       username =  "${var.username}"
       tags_environment    = "${var.tags_environment}"
     }
  
     module "mysql" {
       source                             = "./../modules/mysql/"
     }
  </code></pre>
  
  <p>Azure key vault module.</p>
  
  <pre><code>  name                        = "${var.lsrkeyvault}"
    location                    = "${data.azurerm_resource_group.lsr.location}"
    resource_group_name         = "${data.azurerm_resource_group.lsr.name}"
    enabled_for_disk_encryption = true
    tenant_id           = "${data.azurerm_client_config.current.tenant_id}" 
  
    sku_name = "standard
  resource "azurerm_key_vault_secret" "userlist" {
    count = length(var.username)
    name  = "${var.username[count.index]}"
    value =  "${bcrypt(random_string.password.result)}" 
    key_vault_id = "${azurerm_key_vault.kvlsr.id}"
    tags = {
      environment = "${var.tags_environment}"
    }
  }
  </code></pre>
  
  <p>Mysql Module code:</p>
  
  <pre><code>    name                            =  "kyv-lsr-dev"
      resource_group_name = "rgroup"
     }
  
  data "azurerm_key_vault_secret" "userlist" {
        name         = "mylab"
        key_vault_id = "${data.azurerm_key_vault.keyvault.id}"
  </code></pre>