Skip to content

About

Azure Synapse Analytics Terraform module — parameterised, azurerm 4.x, CI-validated · AIRCLOUD

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AIRCLOUD: DevOps, cloud and AI engineering

azure-synapse-module

Azure Synapse Analytics Terraform module — parameterised, azurerm 4.x, CI-validated.

CI License: MIT Release

Enterprise-grade Azure Synapse Analytics module with comprehensive security, compliance, and performance features.

Features

✅ Unified Analytics - SQL pools, Spark pools, data integration
✅ Advanced Security - Customer-managed keys, private endpoints, threat protection
✅ Managed Virtual Network - Secure network isolation, data exfiltration protection
✅ Data Lake Integration - Native integration with ADLS Gen2
✅ Git Integration - Source control for notebooks and pipelines
✅ Performance - Auto-scaling, auto-pause, optimized resource usage
✅ Compliance - Azure Policy integration, audit logging
✅ Identity - Azure AD authentication, managed identities

Usage

Pin the module to a release tag:

module "synapse" {
  source = "git::https://github.com/AIRCLOUD-PL/azure-synapse-module.git?ref=v1.0.0"

  # required inputs
  environment                          = "..."
  location                             = "..."
  resource_group_name                  = "..."
  storage_data_lake_gen2_filesystem_id = "..."
}

All inputs and outputs are listed in the generated reference below (Inputs, Outputs). Worked examples live in examples/.

Basic Example

module "synapse" {
  source = "git::https://github.com/AIRCLOUD-PL/azure-synapse-module.git?ref=v1.0.0"

  synapse_workspace_name              = "synapse-prod-westeurope-001"
  location                          = "westeurope"
  resource_group_name               = "rg-production"
  environment                       = "prod"
  storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.main.id
  sql_administrator_login           = "sqladmin"
  sql_administrator_login_password  = "P@ssw0rd123!"

  tags = {
    Environment = "Production"
  }
}

Complete Example with Security

module "synapse" {
  source = "git::https://github.com/AIRCLOUD-PL/azure-synapse-module.git?ref=v1.0.0"

  synapse_workspace_name              = "synapse-prod-westeurope-001"
  location                          = "westeurope"
  resource_group_name               = "rg-production"
  environment                       = "prod"
  storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.main.id
  sql_administrator_login           = "sqladmin"
  sql_administrator_login_password  = "P@ssw0rd123!"

  # Security
  managed_virtual_network_enabled      = true
  data_exfiltration_protection_enabled = true
  public_network_access_enabled        = false
  azuread_authentication_only          = true
  identity_type                        = "SystemAssigned"

  # Customer-managed encryption
  customer_managed_key = {
    key_versionless_id = azurerm_key_vault_key.synapse.id
  }

  # Git integration
  github_repo = {
    account_name    = "AIRCLOUD-PL"
    branch_name     = "main"
    repository_name = "synapse-analytics"
    root_folder     = "/"
  }

  # Security features
  enable_security_alert_policy    = true
  enable_vulnerability_assessment = true
  enable_extended_auditing_policy = true

  # Dedicated SQL Pools
  dedicated_sql_pools = {
    "datawarehouse" = {
      sku_name = "DW1000c"
      geo_backup_policy_enabled = true
      data_encrypted           = true
    }

    "reporting" = {
      sku_name = "DW500c"
      geo_backup_policy_enabled = true
    }
  }

  # Spark Pools
  spark_pools = {
    "sparkpool" = {
      node_size_family = "MemoryOptimized"
      node_size        = "Large"
      node_count       = 5

      auto_scale = {
        max_node_count = 10
        min_node_count = 3
      }

      auto_pause = {
        delay_in_minutes = 15
      }

      spark_version = "3.2"
    }

    "smallpool" = {
      node_size_family = "MemoryOptimized"
      node_size        = "Small"
      node_count       = 3

      auto_pause = {
        delay_in_minutes = 30
      }
    }
  }

  # Private Endpoints
  private_endpoints = {
    synapse_sql = {
      subnet_id = azurerm_subnet.database.id
      private_dns_zone_ids = [
        azurerm_private_dns_zone.synapse_sql.id
      ]
    }

    synapse_sql_on_demand = {
      subnet_id = azurerm_subnet.database.id
      private_dns_zone_ids = [
        azurerm_private_dns_zone.synapse_sqlod.id
      ]
    }

    synapse_dev = {
      subnet_id = azurerm_subnet.development.id
      private_dns_zone_ids = [
        azurerm_private_dns_zone.synapse_dev.id
      ]
    }
  }

  # Firewall Rules (for maintenance)
  firewall_rules = {
    "azure-services" = {
      start_ip_address = "0.0.0.0"
      end_ip_address   = "0.0.0.0"
    }
  }

  tags = {
    Environment = "Production"
    DataClass   = "Confidential"
    Compliance  = "SOX"
  }
}

Examples

  • Basic - Simple Synapse workspace
  • Complete - Full enterprise features

Security Features

Data Protection

  • Customer-Managed Keys - Full encryption control
  • Advanced Threat Protection - Real-time security monitoring
  • Data Exfiltration Protection - Prevent data leakage
  • Private Endpoints - Secure private connectivity

Network Security

  • Managed Virtual Network - Network isolation
  • VNet Integration - Secure network access
  • Firewall Rules - Granular access control
  • IP Filtering - Network-level security

High Availability

  • Geo-Redundancy - Cross-region replication
  • Automatic Failover - Zero-downtime failover
  • Backup & Recovery - Point-in-time restore
  • Disaster Recovery - Business continuity

Compliance & Governance

  • Azure Policy - Automated compliance
  • Audit Logging - Comprehensive audit trails
  • Resource Locks - Prevent accidental deletion
  • Azure AD Integration - Modern authentication

Version

Current version: v1.0.0

License

MIT

Reference

Requirements

Name Version
terraform >= 1.5.0
azurerm ~> 4.0

Providers

Name Version
azurerm 4.81.0

Modules

No modules.

Resources

Name Type
azurerm_private_endpoint.synapse_dev resource
azurerm_private_endpoint.synapse_sql resource
azurerm_private_endpoint.synapse_sql_on_demand resource
azurerm_resource_group_policy_assignment.synapse_auditing resource
azurerm_resource_group_policy_assignment.synapse_data_exfiltration resource
azurerm_resource_group_policy_assignment.synapse_encryption resource
azurerm_resource_group_policy_assignment.synapse_managed_vnet resource
azurerm_resource_group_policy_assignment.synapse_threat_detection resource
azurerm_synapse_firewall_rule.firewall_rules resource
azurerm_synapse_spark_pool.pools resource
azurerm_synapse_sql_pool.dedicated_pools resource
azurerm_synapse_workspace.main resource
azurerm_synapse_workspace_extended_auditing_policy.main resource
azurerm_synapse_workspace_security_alert_policy.main resource
azurerm_synapse_workspace_vulnerability_assessment.main resource
azurerm_resource_group.main data source

Inputs

Name Description Type Default Required
auditing_policy_retention_in_days Retention days for auditing logs number 30 no
auditing_policy_storage_account_access_key Storage account access key for auditing string null no
auditing_policy_storage_endpoint Storage endpoint for auditing policy string null no
azuread_authentication_only Enable Azure AD authentication only bool false no
customer_managed_key Customer managed key configuration
object({
key_versionless_id = string
})
null no
data_exfiltration_protection_enabled Enable data exfiltration protection bool true no
dedicated_sql_pools Dedicated SQL pools configuration
map(object({
sku_name = string
storage_account_type = optional(string, "GRS")
create_mode = optional(string, "Default")
recovery_database_id = optional(string)
restore = optional(object({
source_database_id = string
point_in_time = string
}))
geo_backup_policy_enabled = optional(bool, true)
data_encrypted = optional(bool, true)
collation = optional(string, "SQL_Latin1_General_CP1_CI_AS")
}))
{} no
enable_extended_auditing_policy Enable extended auditing policy bool true no
enable_policy_assignments Enable Azure Policy assignments for this Synapse workspace bool true no
enable_security_alert_policy Enable security alert policy bool true no
enable_vulnerability_assessment Enable vulnerability assessment bool true no
environment Environment name (e.g., prod, dev, test) string n/a yes
firewall_rules Firewall rules configuration
map(object({
start_ip_address = string
end_ip_address = string
}))
{} no
github_repo GitHub repository configuration
object({
account_name = string
branch_name = string
repository_name = string
root_folder = optional(string, "/")
})
null no
identity_ids List of User Assigned Identity IDs list(string) [] no
identity_type Type of Managed Identity string "SystemAssigned" no
linking_allowed_for_aad_tenant_ids List of AAD tenant IDs allowed for linking list(string) [] no
location Azure region where resources will be created string n/a yes
managed_resource_group_name Name of the managed resource group string null no
managed_virtual_network_enabled Enable managed virtual network bool true no
naming_prefix Prefix for Synapse naming string "synapse" no
private_endpoints Private endpoint configurations
object({
synapse_sql = optional(object({
subnet_id = string
private_dns_zone_ids = optional(list(string))
}))
synapse_sql_on_demand = optional(object({
subnet_id = string
private_dns_zone_ids = optional(list(string))
}))
synapse_dev = optional(object({
subnet_id = string
private_dns_zone_ids = optional(list(string))
}))
})
{} no
public_network_access_enabled Enable public network access bool false no
purview_id Purview resource ID for integration string null no
resource_group_name Name of the resource group string n/a yes
security_alert_policy_disabled_alerts Disabled alerts for security policy list(string) [] no
security_alert_policy_email_account_admins Email account admins for security alerts bool true no
security_alert_policy_email_addresses Email addresses for security alerts list(string) [] no
security_alert_policy_retention_days Retention days for security alerts number 30 no
security_alert_policy_storage_account_access_key Storage account access key for security alerts string null no
security_alert_policy_storage_endpoint Storage endpoint for security alerts string null no
spark_pools Spark pools configuration
map(object({
node_size_family = string
node_size = string
node_count = optional(number, 3)

auto_scale = optional(object({
max_node_count = number
min_node_count = number
}))

auto_pause = optional(object({
delay_in_minutes = number
}))

spark_version = optional(string, "3.2")

library_requirement = optional(object({
content = string
filename = string
}))
}))
{} no
sql_administrator_login SQL administrator login name string null no
sql_administrator_login_password SQL administrator login password string null no
sql_identity_control_enabled Enable SQL identity control bool true no
storage_data_lake_gen2_filesystem_id ID of the Data Lake Storage Gen2 filesystem string n/a yes
synapse_workspace_name Name of the Synapse workspace. If null, will be auto-generated. string null no
tags Tags to apply to all resources map(string) {} no
vulnerability_assessment_emails Email addresses for vulnerability scans list(string) [] no
vulnerability_assessment_recurring_scans_enabled Enable recurring vulnerability scans bool true no
vulnerability_assessment_storage_account_access_key Storage account access key for vulnerability assessment string null no
vulnerability_assessment_storage_container_path Storage container path for vulnerability assessment string null no

Outputs

Name Description
dedicated_sql_pools Dedicated SQL pools
firewall_rules Firewall rules
identity Managed identity block
identity_principal_id Principal ID of the system-assigned managed identity
private_endpoint_synapse_dev_id Synapse Dev private endpoint ID
private_endpoint_synapse_sql_id Synapse SQL private endpoint ID
private_endpoint_synapse_sql_on_demand_id Synapse SQL on-demand private endpoint ID
spark_pools Spark pools
synapse_workspace_connectivity_endpoints Synapse workspace connectivity endpoints
synapse_workspace_id Synapse workspace ID
synapse_workspace_managed_resource_group_name Managed resource group name
synapse_workspace_name Synapse workspace name

Part of the AIRCLOUD Azure module catalog

Browse all modules with usage snippets in the module catalog or on github.com/AIRCLOUD-PL. Built and maintained by AIRCLOUD: DevOps, cloud and AI engineering. Need a hand with Azure landing zones or platform engineering? See aircloud.com.pl/consulting.

About

Azure Synapse Analytics Terraform module — parameterised, azurerm 4.x, CI-validated · AIRCLOUD

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages