diff --git a/modules/azurerm/Synapse-Workspace/outputs.tf b/modules/azurerm/Synapse-Workspace-Storage-Account/outputs.tf similarity index 100% rename from modules/azurerm/Synapse-Workspace/outputs.tf rename to modules/azurerm/Synapse-Workspace-Storage-Account/outputs.tf diff --git a/modules/azurerm/Synapse-Workspace/synapse_workspace.tf b/modules/azurerm/Synapse-Workspace-Storage-Account/synapse_workspace_storage_account.tf similarity index 63% rename from modules/azurerm/Synapse-Workspace/synapse_workspace.tf rename to modules/azurerm/Synapse-Workspace-Storage-Account/synapse_workspace_storage_account.tf index fda072ad..119b2ad6 100644 --- a/modules/azurerm/Synapse-Workspace/synapse_workspace.tf +++ b/modules/azurerm/Synapse-Workspace-Storage-Account/synapse_workspace_storage_account.tf @@ -18,14 +18,33 @@ # # -------------------------------------------------------------------------------------- +resource "azurerm_storage_account" "storage_account" { + name = join("", ["st", var.storage_account_name]) + resource_group_name = var.resource_group_name + location = var.location + account_tier = "Standard" + account_replication_type = "LRS" + account_kind = "StorageV2" + is_hns_enabled = true + tags = var.tags +} + +resource "azurerm_storage_data_lake_gen2_filesystem" "storage_data_lake_gen2_filesystem" { + name = join("", ["fs", var.storage_account_name]) + storage_account_id = azurerm_storage_account.storage_account.id +} + resource "azurerm_synapse_workspace" "synapse_workspace" { name = join("-", ["synw", var.name]) resource_group_name = var.resource_group_name location = var.location - storage_data_lake_gen2_filesystem_id = var.storage_data_lake_gen2_filesystem_id + storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.storage_data_lake_gen2_filesystem.id sql_administrator_login = var.sql_administrator_login sql_administrator_login_password = var.sql_administrator_login_password managed_virtual_network_enabled = var.managed_virtual_network_enabled data_exfiltration_protection_enabled = var.data_exfiltration_protection_enabled + identity { + type = "SystemAssigned" + } tags = var.tags } diff --git a/modules/azurerm/Synapse-Workspace/variables.tf b/modules/azurerm/Synapse-Workspace-Storage-Account/variables.tf similarity index 93% rename from modules/azurerm/Synapse-Workspace/variables.tf rename to modules/azurerm/Synapse-Workspace-Storage-Account/variables.tf index d8b0e00e..0d0bf57d 100644 --- a/modules/azurerm/Synapse-Workspace/variables.tf +++ b/modules/azurerm/Synapse-Workspace-Storage-Account/variables.tf @@ -61,6 +61,11 @@ variable "data_exfiltration_protection_enabled" { default = false } +variable "storage_account_name" { + description = "The name of the Storage account linked to the Synapse Workspace" + type = string +} + variable "tags" { description = "A mapping of tags to assign to the resource" type = map(string) diff --git a/modules/azurerm/Synapse-Workspace/versions.tf b/modules/azurerm/Synapse-Workspace-Storage-Account/versions.tf similarity index 100% rename from modules/azurerm/Synapse-Workspace/versions.tf rename to modules/azurerm/Synapse-Workspace-Storage-Account/versions.tf