Skip to content

Commit

Permalink
Refactor synapse workspace module
Browse files Browse the repository at this point in the history
  • Loading branch information
VimukthiPerera authored and Vimukthi Perera committed Nov 21, 2024
1 parent c30c538 commit 45df8b8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
tags = var.tags
identity {
type = "SystemAssigned"
}
tags = var.tags
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 45df8b8

Please sign in to comment.