I’m creating multiple Datalake’s and later filesystems in each. The data lake creation is working fine. But it throws error while creating the filesystem.
The error message:
Error: creating File System “adlsfilesystem1” in Storage Account “test1bdls9404”: datalakestore.Client#Create: Failure responding to request: StatusCode=404 – Original Error: autorest/azure: Service returned an error. Status=404 Code=“ResourceNotFound” Message="The specified resource does not exist.
config:
adls = {
adls1 = {
resourcetype = “dls”
account_tier = “Standard”
account_kind = “StorageV2”
access_tier = “Hot”
account_replication_type = “LRS”
min_tls_version = “TLS1_2”
is_hns_enabled = true
dls = {
dls = [
“test1”, "test2
]
}
}
}
ADLS deployment
resource “azurerm_storage_account” “datalake” {
for_each = var.adls
name = “${var.dls_name}”
resource_group_name = var.resourcegpname
location = var.resourcelocation
account_tier = var.account_tier
account_replication_type = var.account_replication_type
account_kind = var.account_kind
access_tier = var.access_tier
enable_https_traffic_only = true
min_tls_version = var.min_tls_version
is_hns_enabled = var.is_hns_enabled
allow_nested_items_to_be_public = false
}
Wait
resource “time_sleep” “wait_few_mins” {
depends_on = [azurerm_storage_account.datalake]
create_duration = “50s”
}
ADLS FS
module “filesystem” {
for_each = { for p in azurerm_storage_account.datalake : tostring(p.name) => p }
source = “…/deploy_filesystem”
adlsfilesystems = var.adlsfilesystems
sta_id = each.value[“id”]
sta_name = each.value[“name”]
depends_on = [
time_sleep.wait_few_mins
]
}
Filesystem
resource “azurerm_storage_data_lake_gen2_filesystem” “storagedlsgen2fs” {
for_each = var.adlsfilesystems
name = each.value[“name”]
storage_account_id = var.sta_id
}
I tried to put wait function but still the same issue. Is there a possibility to run the File system creation task sequentially?
Thank you