Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor synapse workspace module #117

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = var.account_tier
account_replication_type = var.account_replication_type
account_kind = var.account_kind
is_hns_enabled = var.is_hns_enabled
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,35 @@ 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 "account_tier" {
description = "The tier of the storage account"
type = string
default = "Standard"
}

variable "account_replication_type" {
description = "The replication type of the storage account"
type = string
default = "LRS"
}

variable "account_kind" {
description = "The kind of storage account"
type = string
default = "StorageV2"
}

variable "is_hns_enabled" {
description = "Enable or disable Hierarchical Namespace"
type = bool
default = true
}

variable "tags" {
description = "A mapping of tags to assign to the resource"
type = map(string)
Expand Down
Loading