Skip to content

data-platform-hq/terraform-azurerm-mssql-database

Repository files navigation

Azure Microsoft SQL Database Terraform module

Terraform module for creation Azure Microsoft SQL Database

TODO - Update README

Usage

Requirements

Name Version
terraform >= 1.0.0
azurerm >= 3.23.0

Providers

Name Version
azurerm 3.24.0

Modules

No modules.

Resources

Name Type
azurerm_mssql_database.this resource
azurerm_monitor_diagnostic_setting.this resource

Inputs

Name Description Type Default Required
project Project name string n/a yes
env Environment name string n/a yes
location Azure location string n/a yes
server_id Id of SQL server string n/a yes
server_fqdn FQDN of Azure SQL Server string n/a yes
tags tags for resources map(string) {} no
default_collation Specifies the collation of the database string SQL_Latin1_General_CP1_CI_AS no
default_sku Specifies the SKU of the database string GP_S_Gen5_1 no
default_max_size The max size of the database in gigabytes string 20 no
default_min_capacity The min size of the database in gigabytes string 0.5 no
default_autopause_delay Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled string 60 no
default_retention_days Specifies the number of days to keep in the Threat Detection audit logs string 3 no
default_create_mode Type of create mode selected in database config object string Default no
default_creation_source_database_id This variable is used in case 'create_mode'='Copy' string null no
storage_account_type Specifies the storage account type used to store backups for this database string ZRS no
databases Map of databases map(map(string)) {} no
log_analytics_workspace_id Log Analytics Workspace ID string n/a no
log_category_list Category list log list(any)
[
"QueryStoreRuntimeStatistics",
"QueryStoreWaitStatistics",
"QueryStoreWaitStatistics",
"Errors",
"DatabaseWaitStatistics",
"Timeouts",
"Blocks",
"Deadlocks"
]
no
category_list_metrics Category list metrics list(any)
[
"Basic",
"WorkloadManagement"
]
no
log_retention_days Retention log policy days number 7 no
metric_retention_days Retention metric policy days number 7 no
destination_type Log analytics destination type string Dedicated no

Outputs

Name Description
mssql_database_secrets Map of Database Name to JDBC Connection String
sql_database_id Id of Database
sql_server_id Id of SQL server
sql_database_names Database name of the Azure SQL Database created
sql_database_max_size Database max size in GB of the Azure SQL Database created
storage_account_type Storage Account Type

License

Apache 2 Licensed. For more information please see LICENSE