Skip to content
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
1 change: 1 addition & 0 deletions modules/mssql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module "mssql" {
| project\_id | The project ID to manage the Cloud SQL resources | `string` | n/a | yes |
| random\_instance\_name | Sets random suffix at the end of the Cloud SQL resource name | `bool` | `false` | no |
| region | The region of the Cloud SQL resources | `string` | `"us-central1"` | no |
| retain\_backups\_on\_delete | When this parameter is set to true, Cloud SQL retains backups of the instance even after the instance is deleted. The ON\_DEMAND backup will be retained until customer deletes the backup or the project. The AUTOMATED backup will be retained based on the backups retention setting. | `bool` | `false` | no |
| root\_password | MSSERVER password for the root user. If not set, a random one will be generated and available in the root\_password output variable. | `string` | `""` | no |
| secondary\_zone | The preferred zone for the read replica instance, it should be something like: `us-central1-a`, `us-east1-c`. | `string` | `null` | no |
| sql\_server\_audit\_config | SQL server audit config settings. | `map(string)` | `{}` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/mssql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ resource "google_sql_database_instance" "default" {
deletion_protection_enabled = var.deletion_protection_enabled
connector_enforcement = local.connector_enforcement
enable_dataplex_integration = var.enable_dataplex_integration
retain_backups_on_delete = var.retain_backups_on_delete

dynamic "backup_configuration" {
for_each = !local.is_secondary_instance && var.backup_configuration.enabled ? [var.backup_configuration] : []
Expand Down
6 changes: 6 additions & 0 deletions modules/mssql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ variable "backup_configuration" {
}
}

variable "retain_backups_on_delete" {
description = "When this parameter is set to true, Cloud SQL retains backups of the instance even after the instance is deleted. The ON_DEMAND backup will be retained until customer deletes the backup or the project. The AUTOMATED backup will be retained based on the backups retention setting."
type = bool
default = false
}

variable "db_name" {
description = "The name of the default database to create"
type = string
Expand Down