Skip to content

Commit

Permalink
fix(aks): add dependencies to fix reading of storage account
Browse files Browse the repository at this point in the history
  • Loading branch information
lentidas committed Jan 22, 2024
1 parent 2f9172e commit 1e39499
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions aks/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
# This null_resource is required otherwise Terraform would try to read the resource group data and/or the storage
# account even if they were not created yet.
resource "null_resource" "dependencies" {
triggers = var.dependency_ids
}

data "azurerm_resource_group" "node_resource_group" {
count = local.use_managed_identity ? 1 : 0

name = var.metrics_storage.managed_identity_node_rg_name

depends_on = [
resource.null_resource.dependencies
]
}

data "azurerm_storage_container" "container" {
count = local.use_managed_identity ? 1 : 0

name = var.metrics_storage.container
storage_account_name = var.metrics_storage.storage_account

depends_on = [
resource.null_resource.dependencies
]
}

resource "azurerm_user_assigned_identity" "thanos" {
Expand Down

0 comments on commit 1e39499

Please sign in to comment.