diff --git a/terraform/modules/postgres/main.tf b/terraform/modules/postgres/main.tf index 9db23be9..860ece56 100644 --- a/terraform/modules/postgres/main.tf +++ b/terraform/modules/postgres/main.tf @@ -19,17 +19,17 @@ resource "azurerm_postgresql_server" "sql" { storage_mb = var.storage_mb backup_retention_days = var.storage_backup_retention_days geo_redundant_backup = var.storage_geo_redundant_backup - auto_grow = var.stroage_auto_grow + auto_grow = var.storage_auto_grow } - administrator_login = "sqladmindude" - administrator_login_password = "eI0l7yswwtuhHpwzoVjwRKdAcuGNsg" - version = "11" - ssl_enforcement = "Enabled" + administrator_login = var.administrator_login + administrator_login_password = var.administrator_login_password + version = var.postgres_version + ssl_enforcement = var.ssl_enforcement } resource "azurerm_postgresql_virtual_network_rule" "sql" { - name = "postgresql-vnet-rule" + name = "${var.name}-${var.environment}-rule" resource_group_name = azurerm_resource_group.sql.name server_name = azurerm_postgresql_server.sql.name subnet_id = var.subnet_id diff --git a/terraform/modules/postgres/variables.tf b/terraform/modules/postgres/variables.tf index 91af61bc..3346ff8f 100644 --- a/terraform/modules/postgres/variables.tf +++ b/terraform/modules/postgres/variables.tf @@ -51,7 +51,7 @@ variable "sku_family" { variable "storage_mb" { type = string description = "Size in MB of the storage used for the sql server" - default = "5000" + default = "5120" } @@ -73,3 +73,28 @@ variable "storage_auto_grow" { default = "Enabled" } +variable "administrator_login" { + type = string + description = "Administrator login" + default = "sqladmindude" # FIXME - Remove with wrapper using KeyVault +} + +variable "administrator_login_password" { + type = string + description = "Administrator password" + default = "eI0l7yswwtuhHpwzoVjwRKdAcuGNsg" # FIXME - Remove with wrapper using KeyVault +} + + +variable "postgres_version" { + type = string + description = "Postgres version to use" + default = "11" +} + +variable "ssl_enforcement" { + type = string + description = "Enforce SSL (Enabled/Disable)" + default = "Enabled" +} +